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/admin/admin_edit.php

    r18635 r20034  
    5353//========== Mode GLOBAL ================================
    5454
     55
    5556check_input_parameter('selection', $_POST, true, PATTERN_ID);
    5657include (PHPWG_ROOT_PATH.'admin/batch_manager.php');
    5758    $tabsheet = new tabsheet();
    58     $tabsheet->assign();
    59  
    60 
     59    $tabsheet->assign(); 
    6160
    6261if(isset($page['cat_elements_id']))
    6362    $template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d image', '%d images', count($page['cat_elements_id'])).' - '.$page['title']); 
    6463
    65  
     64
    6665 if(isset($_POST)){
    67 // $info_message .= cl_edit_functions::Memo_Vars($_POST);
    68 
     66// $info_message .= cl_print_var($_POST);
    6967//===============================================================
    7068$collection = array();
     
    103101$adresse =  $lang_info['country'];   ;
    104102$adresse=str_replace("/",", ",$adresse);
    105  
     103global $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                 
    106118if (count($collection)>0 )
    107119  if ( isset($_POST['update']) && ( $_POST['update']==l10n('update_exif') || $_POST['update'] == l10n('update_all')  )){
     
    299311                $j++ ;
    300312            } else{
    301             //   $info_message .= cl_edit_functions::Memo_Vars($current[$j]);
     313            //   $info_message .= cl_print_var($current[$j]);
    302314                break ;
    303315            }
     
    342354$match="";
    343355if ( isset($_POST['submit'])   ) {
    344 
     356if ( isset($_POST['match']) && $_POST['match']!='' ){   
     357      cl_edit_controler::cl_edit_Set_Options();
     358      cl_edit_controler::cl_edit_sauve_options_inf();
     359  }
    345360 if ($_POST['submit']==l10n('selection') ) {
    346361    $collection =$_POST['selection'];
    347362  }
     363
    348364  if ($_POST['submit']==l10n('add') ) {
    349365    $_POST['selection']=array();
     
    359375//=================================================================================
    360376$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
    370378//======================================================================
    371379if (isset($_POST['submit']) and $_POST['submit']==l10n('selection' )){
     
    387395              $infos_gps  =  cl_edit_controler::Get_exif_gps( $image['path'],$image,false,false) ;           
    388396               
    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']){     
    392402                        $image['lat']=$infos_gps['lat'];
    393403                        $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              }
    397412              //==========================================
    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 ;                     
    406415                //=====================================================
    407416                $template->assign( 'coordinates',
     
    417426              }
    418427              //=====================================================
    419                     $lon=$image['lon'];
    420                     $lat=$image['lat'];
     428                           
     429
     430
     431
     432
    421433                    $lonDMS= dec2dms($lon) ;
    422434                    $latDMS= dec2dms($lat) ;
     
    456468//============================================================
    457469 if ( !empty($first_image)) {
    458    $erreur_message .= cl_edit_functions::Memo_Vars($first_image);
     470   $erreur_message .= cl_print_var($first_image);
    459471   
    460472   if (isset($_POST['update'])) {
Note: See TracChangeset for help on using the changeset viewer.