Changeset 20034 for extensions/edit_gmaps/edit_gmaps.inc.php
- Timestamp:
- Jan 10, 2013, 9:55:42 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 ?>
Note: See TracChangeset
for help on using the changeset viewer.