Ignore:
Timestamp:
Sep 6, 2012, 5:44:55 PM (12 years ago)
Author:
cljosse
Message:

[extensions] edit_gmaps compatibility 2.4 memory locations

Location:
extensions/edit_gmaps/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/edit_gmaps/admin/admin_edit.php

    r17777 r17779  
    104104if (count($collection)>0 )
    105105  if (isset($_POST['update']) && $_POST['update']==l10n('update_exif')){
    106     /*******************************
     106    /***********************************
    107107    *  Mise à jour des meta données
    108     *******************************/
     108    ************************************/
    109109    // error_reporting ( 0 );
    110110    // Hide any unknown EXIF tags   
     
    141141              //=================================================================
    142142                $infos_gps  = array();
    143                 $infos_gps  = cl_edit_controler::Get_exif_gps( $image['path'],$image,false) ;
     143                $lat = trim($_POST['lat']);
     144                $lon = trim($_POST['lon']);
     145                $alt = '';
     146      if(isset($_POST['alt']))
     147                $alt = trim($_POST['alt']);
     148
     149                if($image['lat']=='' || $image['lon']==''){
     150                    $image['lat']=$lat;
     151                    $image['lon']=$lon;
     152                    $image['alt']=$alt;
     153                }     
     154                $infos_gps  = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,true) ;
     155
    144156                if($image['lat']=='' || $image['lon']==''){
    145157                    $image['lat']=$infos_gps['lat'];
     
    165177           if(  cl_edit_controler::add_meta_gps($new_ps_file_info_array,$image)){
    166178                  $exif = @read_exif_data( $image['path']);
    167                   $infos_gps  = cl_edit_controler::Get_exif_gps( $image['path'],$image,false) ;
    168                   $info_message .=l10n('update_exif') . ": " .  $image['path'] . " : " . $image['file'] . " : ok<BR />";
     179                  $infos_gps  = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,true) ;
     180                  $info_message .=l10n('update_exif') . " : " .  $image['path'] . " : " . $image['file'] . " : ok<BR />";
    169181                }else{
    170182
     
    191203       if($lat !="") cl_edit_controler::add_data_base($collection,$lat,$lon,$alt) ;
    192204        $_POST['submit'] = l10n('selectAction') ;
     205        unset($_POST['submit']);
    193206        foreach ($collection as $id_0){
    194207          foreach ($images as $image) { 
    195208            if (array_search($id_0,$image)) { 
    196               $image['lat'] =    $lat ;
    197               $image['lon']= $lon  ;
    198               $image['alt'] =$alt  ;
     209              $image['lat'] = $lat ;
     210              $image['lon']=  $lon  ;
     211              $image['alt'] = $alt  ;
    199212           }
    200213          }
     
    234247//========================================================================
    235248  $v_exif="";
    236  $current = $template->get_template_vars('thumbnails'); 
    237  $j=0;
    238  $thumbnails= array();
    239 foreach ($images as $image){ 
     249  $current = $template->get_template_vars('thumbnails'); 
     250  $j=0;
     251  $thumbnails= array();
     252/*************************************
     253* AFFICHAGE MODE GLOBAL
     254*************************************/
     255  foreach ($images as $image){ 
    240256    $infos_gps  = array();
    241     $infos_gps  =  cl_edit_controler::Get_exif_gps( $image['path'],$image,false) ;
     257    $infos_gps  =  cl_edit_controler::Get_exif_gps( $image['path'],$image,false,false) ;
     258   
    242259    $v_exif=$infos_gps['is_exif']?"EXIF":"NO" ;   
    243260    $v_db=false  ;
     
    252269      $sel_img= array($image['id']);
    253270      if ($new){
    254 
    255               cl_edit_controler::add_data_base( $sel_img,$image['lat'],$image['lon'],$image['alt']) ;
     271           cl_edit_controler::add_data_base( $sel_img,$image['lat'],$image['lon'],$image['alt']) ;
    256272      }           
    257273   }         
     
    347363        foreach ($images as $image) {
    348364            if (array_search($id_0,$image)) {   
    349               $infos_gps  = array();   
    350               if($image['lat']=='' || $image['lon']==''){    }
     365
     366              $infos_gps  = array();               
    351367              $infos_gps  =array();
    352               $infos_gps  =  cl_edit_controler::Get_exif_gps( $image['path'],$image,false) ;
    353               if(isset($infos_gps['lat']) && $infos_gps['is_exif']){       
    354                 $image['lat']=$infos_gps['lat'];
    355                 $image['lon']=$infos_gps['lon'];
    356                 $image['alt']=$infos_gps['alt'];
    357               }                   
    358               if ( $init_info && $image['lat'] <> '' ) {
     368              $infos_gps  =  cl_edit_controler::Get_exif_gps( $image['path'],$image,false,false) ;           
     369               
     370              if(isset($infos_gps['lat']) && $infos_gps['is_exif']){     
     371              //======= test affichage BD ================
     372                if($image['lat']=='' || $image['lon']==''){ 
     373                        $image['lat']=$infos_gps['lat'];
     374                        $image['lon']=$infos_gps['lon'];
     375                        $image['alt']=$infos_gps['alt'];             
     376                }
     377              }       
     378              //==========================================
     379                       
     380              if ( $init_info && $image['lat'] <> '' ) {               
     381
    359382                $init_info = false ;
    360383                $lat = ($image['lat'] <> '') ? $image['lat'] : '100'  ;
     
    381404                    $v_db=false  ;
    382405                    $v_db=$lon!=0 && $lat!=0;
     406
    383407                    $tpl_var = array_merge(
    384408                        $image,
     
    424448     if (!empty($infos_gps))
    425449         $Position = $infos_gps ;
    426      else  $Position =  cl_edit_controler::Get_exif_gps($filename,$image,false) ;
     450     else 
     451         $Position =  cl_edit_controler::Get_exif_gps($filename,$image,false,true) ;
    427452
    428453      $jpeg_header_data = get_jpeg_header_data($filename );
  • extensions/edit_gmaps/admin/admin_edit.tpl

    r17776 r17779  
    7777   title="{'selection'|@translate}|{'hlp_line3'|@translate}.";   
    7878   value="{'selection'|@translate}" ;
    79    message='<p><input class="cluetip submit" type="submit" name="submit"   title="'+ title +'" value="'+ value +'"  /> ';
     79   message ='<p><input class="cluetip submit" type="submit" name="submit"   title="'+ title +'" value="'+ value +'"  /> ';
     80
     81
     82
     83   title="{'update_exif'|@translate}|{'hlp_line3'|@translate}.";   
     84   value="{'update_exif'|@translate}" ;
     85   message +='<input class="cluetip submit" type="submit" name="update"   title="'+ title +'" value="'+ value +'"  /> ';
    8086
    8187   message+='</p>';
     88
    8289  jQuery("#permitAction").append(message);
    8390     
Note: See TracChangeset for help on using the changeset viewer.