Changeset 20034
- Timestamp:
- Jan 10, 2013, 9:55:42 AM (11 years ago)
- Location:
- extensions/edit_gmaps
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/edit_gmaps/admin/admin_edit.php
r18635 r20034 53 53 //========== Mode GLOBAL ================================ 54 54 55 55 56 check_input_parameter('selection', $_POST, true, PATTERN_ID); 56 57 include (PHPWG_ROOT_PATH.'admin/batch_manager.php'); 57 58 $tabsheet = new tabsheet(); 58 $tabsheet->assign(); 59 60 59 $tabsheet->assign(); 61 60 62 61 if(isset($page['cat_elements_id'])) 63 62 $template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d image', '%d images', count($page['cat_elements_id'])).' - '.$page['title']); 64 63 65 64 66 65 if(isset($_POST)){ 67 // $info_message .= cl_edit_functions::Memo_Vars($_POST); 68 66 // $info_message .= cl_print_var($_POST); 69 67 //=============================================================== 70 68 $collection = array(); … … 103 101 $adresse = $lang_info['country']; ; 104 102 $adresse=str_replace("/",", ",$adresse); 105 103 global $EDIT_CL_parametres ; 104 105 $EDIT_CL_parametres = cl_edit_controler::cl_edit_Get_Options(); 106 107 108 $template->assign( 'coordinates', 109 array( 'FILE' => '', 110 'LAT' => ($EDIT_CL_parametres->lat =='')?'100': $EDIT_CL_parametres->lat, 111 'LON' => ($EDIT_CL_parametres->lon =='')?'100': $EDIT_CL_parametres->lon , 112 'ADRESSE' => ($EDIT_CL_parametres->adress =='')?$adresse: $EDIT_CL_parametres->adress , 113 'ZOOM' => 18, 114 'ALT' => $EDIT_CL_parametres->alt =='' ?0: $EDIT_CL_parametres->alt 115 ) 116 ); 117 106 118 if (count($collection)>0 ) 107 119 if ( isset($_POST['update']) && ( $_POST['update']==l10n('update_exif') || $_POST['update'] == l10n('update_all') )){ … … 299 311 $j++ ; 300 312 } else{ 301 // $info_message .= cl_ edit_functions::Memo_Vars($current[$j]);313 // $info_message .= cl_print_var($current[$j]); 302 314 break ; 303 315 } … … 342 354 $match=""; 343 355 if ( isset($_POST['submit']) ) { 344 356 if ( isset($_POST['match']) && $_POST['match']!='' ){ 357 cl_edit_controler::cl_edit_Set_Options(); 358 cl_edit_controler::cl_edit_sauve_options_inf(); 359 } 345 360 if ($_POST['submit']==l10n('selection') ) { 346 361 $collection =$_POST['selection']; 347 362 } 363 348 364 if ($_POST['submit']==l10n('add') ) { 349 365 $_POST['selection']=array(); … … 359 375 //================================================================================= 360 376 $src=""; 361 $template->assign( 'coordinates', 362 array( 'FILE' => '', 363 'LAT' => '100', 364 'LON' => '100', 365 'ADRESSE' => $adresse, 366 'ZOOM' => 18, 367 'ALT' => 0 368 ) 369 ); 377 370 378 //====================================================================== 371 379 if (isset($_POST['submit']) and $_POST['submit']==l10n('selection' )){ … … 387 395 $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,false) ; 388 396 389 if(isset($infos_gps['lat']) && $infos_gps['is_exif']){ 390 //======= test affichage BD ================ 391 if($image['lat']=='' || $image['lon']==''){ 397 398 399 400 if( ($image['lat']=='' || $image['lon']=='')|| $EDIT_CL_parametres->check_exif=='on' ) { 401 if(isset($infos_gps['lat']) && $infos_gps['is_exif']){ 392 402 $image['lat']=$infos_gps['lat']; 393 403 $image['lon']=$infos_gps['lon']; 394 $image['alt']=$infos_gps['alt']; 395 } 396 } 404 $image['alt']=$infos_gps['alt']; 405 } 406 } 407 if($image['lat'] <> ''){ 408 $lon=$image['lon']; 409 $lat=$image['lat']; 410 $alt=$image['alt']; 411 } 397 412 //========================================== 398 399 if ( $init_info && $image['lat'] <> '' ) { 400 401 $init_info = false ; 402 $lat = ($image['lat'] <> '') ? $image['lat'] : '100' ; 403 $lon = ($image['lon'] <> '') ? $image['lon'] : '3.0' ; 404 $alt = ($image['alt'] <> '') ? $image['alt'] : '0' ; 405 413 if ( $init_info && $image['lat'] <> '' ) { 414 $init_info = false ; 406 415 //===================================================== 407 416 $template->assign( 'coordinates', … … 417 426 } 418 427 //===================================================== 419 $lon=$image['lon']; 420 $lat=$image['lat']; 428 429 430 431 432 421 433 $lonDMS= dec2dms($lon) ; 422 434 $latDMS= dec2dms($lat) ; … … 456 468 //============================================================ 457 469 if ( !empty($first_image)) { 458 $erreur_message .= cl_ edit_functions::Memo_Vars($first_image);470 $erreur_message .= cl_print_var($first_image); 459 471 460 472 if (isset($_POST['update'])) { -
extensions/edit_gmaps/edit_gmaps.inc.php
r17779 r20034 35 35 36 36 class cl_edit_functions { 37 static public function Memo_vars($variables) { 38 ob_start(); 39 echo '<pre>'; 40 print_r($variables); 41 echo '</pre>'; 42 $m= ob_get_contents(); 43 ob_end_clean(); 44 return $m; 45 } 46 47 /** 37 38 /************************************** 48 39 * list all columns of each given table 49 * 40 *************************************** 50 41 * @return array of array 51 42 */ … … 260 251 } 261 252 //====================================================== 262 253 static public function cl_edit_admin_menu($menu) 263 254 { 264 255 include_once( dirname(__FILE__) .'/include/functions.php'); … … 271 262 return $menu; 272 263 } 264 /**************************** 265 * 266 *****************************/ 267 static public function cl_edit_Get_Options(){ 268 global $conf,$EDIT_CL_parametres,$infos_message ; 269 if (!isset($conf['edit_gmaps'])){ 270 $q = ' 271 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 272 VALUES ("edit_gmaps","","Parametres du plugin edit_gmaps") 273 ;'; 274 pwg_query($q); 275 276 } 277 $EDIT_CL_parametres = unserialize($conf['edit_gmaps']); 278 if (!isset($EDIT_CL_parametres->lat )){ 279 $EDIT_CL_parametres= cl_edit_controler::cl_edit_Set_Options(); 280 } 281 282 return $EDIT_CL_parametres; 283 } 273 284 /* 274 285 * 275 286 */ 276 function cl_edit_Get_Options() 277 { 278 global $conf,$EDIT_CL_parametres; 279 $EDIT_CL_parametres = unserialize($conf['cl_edit']); 280 $EDIT_CL_parametres = cl_edit_Set_Options(); 281 return $EDIT_CL_parametres; 282 } 283 /* 284 * 285 */ 286 function cl_edit_Set_Options() 287 { 288 287 static public function cl_edit_Set_Options(){ 289 288 global $EDIT_CL_parametres; 290 289 //============================================================================= 291 $my_para=$EDIT_CL_parametres; 292 $my_para->type=(isset($_POST['type']))? $_POST['type']: ((isset($my_para->type)) ? $my_para->type: 'Ty') ; 293 290 $my_para=$EDIT_CL_parametres; 291 $lon= isset($my_para->lon)? $my_para->lon:'' ; 292 $lat= isset($my_para->lat)? $my_para->lat:'' ; 293 $alt= isset($my_para->alt)? $my_para->alt:'0' ; 294 $my_para->lon = (isset($_POST['lon']))? $_POST['lon']: $lon ; 295 $my_para->lat = (isset($_POST['lat']))? $_POST['lat']: $lat ; 296 $my_para->alt = (isset($_POST['alt']))? $_POST['alt']: $alt ; 297 $my_para->adress = (isset($_POST['match']))? $_POST['match']: '' ; 294 298 //=============================================================================== 295 296 299 if ( isset($_POST['selectAction'] ) && $_POST['selectAction'] == l10n('cl_edit_save') ) { 297 $my_para->check_ desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : "off" ;300 $my_para->check_exif = isset($_POST['check_exif']) ? $_POST['check_exif'] : "off" ; 298 301 299 302 }else{ 300 $my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : ( ( isset($my_para->check_desc_v) ) ? $my_para->check_desc_v : 'off') ; 301 302 303 $my_para->check_exif = isset($_POST['check_exif']) ? $_POST['check_exif'] : ( ( isset($my_para->check_exif) ) ? $my_para->check_exif : 'off') ; 303 304 } 304 305 $EDIT_CL_parametres=$my_para; 305 306 return $my_para; 306 } 307 /* 307 308 } 309 /********************** 308 310 * 309 */ 310 function cl_edit_sauve_options_inf() 311 { 312 global $options,$infos_message,$conf,$EDIT_CL_parametres ; 313 $infos_message .=l10n("cl_edit_save_config")."<br>"; 314 $EDIT_CL_parametres=cl_edit_Set_Options(); 315 316 if ( isset($EDIT_CL_parametres) ) 317 { 318 311 **********************/ 312 static public function cl_edit_sauve_options_inf() { 313 global $options,$infos_message,$conf,$EDIT_CL_parametres ; 314 // $infos_message .=l10n("cl_edit_save_config")."<br>". cl_print_var($EDIT_CL_parametres); 315 // cl_aff_infos_plus(); 316 if ( isset($EDIT_CL_parametres) ){ 319 317 $query = ' 320 318 UPDATE '.CONFIG_TABLE.' 321 319 SET value="'.addslashes(serialize($EDIT_CL_parametres)).'" 322 WHERE param = " cl_EDIT_CL"320 WHERE param = "edit_gmaps" 323 321 LIMIT 1'; 324 322 pwg_query($query); 325 } 326 323 } 327 324 } 328 329 325 330 326 331 327 } // class 332 328 333 329 /************************* 330 * 331 *************************/ 332 if(!function_exists("cl_print_var")){ 333 function cl_print_var($variables){ 334 ob_start(); 335 echo '<pre>'; 336 print_r($variables); 337 echo '</pre>'; 338 $m= ob_get_contents(); 339 ob_end_clean(); 340 return $m; 341 } 342 } 343 /****************** 344 * 345 ******************/ 346 if(!function_exists("cl_aff_infos_plus")){ 347 function cl_aff_infos_plus() 348 { 349 global $template,$infos_message,$error_message,$warnings_message, $user ; 350 global $conf,$lang,$page ; 351 //============================================================== 352 if (isset($error_message)) { 353 if ($error_message <> ""){ 354 $error_message=str_replace("\n",'<br />',$error_message) ; 355 $template->assign('errors',$error_message); 356 $error_message=""; 357 } 358 } 359 //============================================================== 360 if (isset($warnings_message)) { 361 if ($warnings_message <> ""){ 362 $warnings_message=str_replace("\n",'<br />',$warnings_message) ; 363 $template->assign('warnings',$warnings_message); 364 $warnings_message=""; 365 } 366 } 367 //============================================= 368 if (isset($infos_message)){ 369 if ($infos_message <> ""){ 370 $infos_message=str_replace("\n",'<br />',$infos_message) ; 371 $template->assign('infos',$infos_message); 372 $infos_message=""; 373 } 374 } 375 //============================================================= 376 return; 377 378 } // function cl_autosize_aff_infos_plus 379 //=============================================================== 380 } 334 381 ?> -
extensions/edit_gmaps/main.inc.php
r18635 r20034 2 2 /* 3 3 Plugin Name: Edit Maps&Earth 4 Version: 2.2. 64 Version: 2.2.7 5 5 Description: Editor for rv gmaps 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=330 -
extensions/edit_gmaps/maintain.inc.php
r9445 r20034 32 32 { 33 33 $dir_name = basename( dirname(__FILE__) ); 34 34 if (!isset($conf['edit_gmaps'])){ 35 $q = ' 36 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 37 VALUES ("edit_gmaps","","Parametres du plugin edit_gmaps") 38 ;'; 39 pwg_query($q); 40 } 35 41 } 36 42 37 function plugin_deactivate() 38 { 39 43 function plugin_deactivate(){ 40 44 cl_meta_invalidate_cache(); 45 global $conf; 46 if (isset($conf['edit_gmaps'])) { 47 $q = ' 48 DELETE FROM '.CONFIG_TABLE.' 49 WHERE param="edit_gmaps" 50 ;'; 51 pwg_query($q); 52 } 41 53 } 42 54 43 function plugin_uninstall() 44 { 55 function plugin_uninstall(){ 45 56 global $conf ; 46 57 $q = 'ALTER TABLE '.IMAGES_TABLE.' DROP COLUMN `alt`'; … … 54 65 pwg_query( $q ); 55 66 } 67 56 68 } 57 69 ?>
Note: See TracChangeset
for help on using the changeset viewer.