Ignore:
Timestamp:
Jan 10, 2013, 9:55:42 AM (11 years ago)
Author:
cljosse
Message:

[extensions] edit_gmaps Minor corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/edit_gmaps/edit_gmaps.inc.php

    r17779 r20034  
    3535
    3636class 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/**************************************
    4839* list all columns of each given table
    49 *
     40***************************************
    5041* @return array of array
    5142*/
     
    260251  }
    261252//======================================================
    262      static public function cl_edit_admin_menu($menu)
     253static public function cl_edit_admin_menu($menu)
    263254    {
    264255            include_once( dirname(__FILE__) .'/include/functions.php');
     
    271262            return $menu;
    272263    }
     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  }
    273284        /*
    274285        *
    275286        */
    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(){
    289288  global $EDIT_CL_parametres;
    290289//=============================================================================
    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']: '' ;
    294298//===============================================================================       
    295 
    296299if ( 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" ;
    298301
    299302         }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') ; 
    303304   }
    304 
     305   $EDIT_CL_parametres=$my_para;
    305306return $my_para;
    306 }
    307         /*
     307
     308}
     309        /**********************
    308310        *
    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) ){
    319317                    $query = '
    320318                    UPDATE '.CONFIG_TABLE.'
    321319                    SET value="'.addslashes(serialize($EDIT_CL_parametres)).'"
    322                     WHERE param = "cl_EDIT_CL"
     320                    WHERE param = "edit_gmaps"
    323321                    LIMIT 1';
    324322                            pwg_query($query);
    325               }
    326          
     323              } 
    327324     }
    328 
    329325
    330326
    331327} // class   
    332328 
    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******************/
     346if(!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}
    334381?>
Note: See TracChangeset for help on using the changeset viewer.