Ignore:
Timestamp:
Sep 6, 2012, 1:11:45 PM (12 years ago)
Author:
cljosse
Message:

[extensions] edit_gmaps compatibility 2.4 add batch mode global

File:
1 edited

Legend:

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

    r17761 r17776  
    4848if (!isset($page['title'])) $page['title']="";
    4949if(!isset($_POST['selectAction'])) $_POST['selectAction']="" ;
    50 
    5150//$info_message .= cl_edit_functions::Memo_Vars($_POST);
     51//========== Mode GLOBAL ================================
    5252check_input_parameter('selection', $_POST, true, PATTERN_ID);
    53 
    5453include (PHPWG_ROOT_PATH.'admin/batch_manager.php');
     54    $tabsheet = new tabsheet();
     55    $tabsheet->assign();
     56 
     57
     58
    5559
    5660if(isset($page['cat_elements_id']))
     
    5862
    5963 
    60     $tabsheet = new tabsheet();
    61     $tabsheet->assign();
    62      
    63  // $current  =  $template->get_template_vars('TAB_DATA');
    64 // prefilters,tags
    65 
    66 //  $erreur_message .= cl_edit_functions::Memo_Vars( $current);
     64 if(isset($_POST)){
     65//  $info_message .= cl_edit_functions::Memo_Vars($_POST);
    6766
    6867//===============================================================
     
    104103 
    105104if (count($collection)>0 )
    106 //=============================================================
    107105  if (isset($_POST['update']) && $_POST['update']==l10n('update_exif')){
    108   /************* Mise à jour des meta données ***************/
     106    /*******************************
     107    *  Mise à jour des meta données
     108    *******************************/
    109109    // error_reporting ( 0 );
    110110    // Hide any unknown EXIF tags   
     
    138138            if (array_search($id_0,$image)) {   
    139139              //=================================================================
    140               // Donnée base de donnée
    141               //=================================================================
    142          //     $info_message .= "<div style='border:2px solid red'>$id_0 Image:" . cl_edit_functions::Memo_vars($image)."</div>" ;
    143                
    144               //=================================================================
    145140              // Meta donnée
    146141              //=================================================================
     
    169164 
    170165           if(  cl_edit_controler::add_meta_gps($new_ps_file_info_array,$image)){
    171              
    172                 $exif = @read_exif_data( $image['path']);
    173                  $infos_gps  = cl_edit_controler::Get_exif_gps( $image['path'],$image,false) ;
    174                 $info_message .= $image['path'] . " : " . $image['file'] . " : ok<BR />";
     166                  $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 />";
    175169                }else{
    176170
     
    186180//======================================================================
    187181if ( isset($_POST['submit'])  ) {
    188   /******** Mise à jour base de données *****/
    189182   if (   $_POST['submit'] == l10n('update_database') ){
     183  /**************************************************
     184   * Uniquement Mise à jour de la base de données
     185   **************************************************/
    190186    if ( count($collection)>0 ){
    191187        $lat = trim($_POST['lat']);
     
    195191       if($lat !="") cl_edit_controler::add_data_base($collection,$lat,$lon,$alt) ;
    196192        $_POST['submit'] = l10n('selectAction') ;
    197             foreach ($collection as $id_0){
     193        foreach ($collection as $id_0){
    198194          foreach ($images as $image) { 
    199195            if (array_search($id_0,$image)) { 
     
    207203    }
    208204 }
    209 
    210205/****************************************/
    211206$query = '
     
    245240    $infos_gps  = array();
    246241    $infos_gps  =  cl_edit_controler::Get_exif_gps( $image['path'],$image,false) ;
    247     $v_exif=$infos_gps['is_exif']?"EXIF":"" ;   
     242    $v_exif=$infos_gps['is_exif']?"EXIF":"NO" ;   
    248243    $v_db=false  ;
    249244    $v_db=$image['lat']!=0 && $image['lon']!=0;
    250     $v_db=$v_db?"BD":"";
    251 
     245    $v_db=$v_db?"BD":"NO";
     246    //==== GPS infos -> image infos ====
    252247    if(  $infos_gps['lat'] !=0  || $infos_gps['lon'] !=0 ) {     
    253248      $new= ( !isset($image['lat'])? true: $image['lat']!=$infos_gps['lat'] ) ;
     
    256251      $image['alt']=$infos_gps['alt'];
    257252      $sel_img= array($image['id']);
    258       if ($new) cl_edit_controler::add_data_base( $sel_img,$image['lat'],$image['lon'],$image['alt']) ;             
     253      if ($new){
     254
     255              cl_edit_controler::add_data_base( $sel_img,$image['lat'],$image['lon'],$image['alt']) ;
     256      }           
    259257   }         
    260258  //=================================================
     
    273271     }
    274272  //=================================================
    275    $tpl_var =  array_merge(
    276                    $current[$j],     array(
    277                   'ID' =>$image['id'],
     273 
     274 $TN_SRC= $current[$j]['TN_SRC'];
     275 $TITLE=$current[$j]['TITLE'] ;
     276 
     277   $tpl_var = array(
     278                  'ID' =>$image['id'],
     279                  'TN_SRC' => $TN_SRC,
     280                  'FILE' => $current[$j]['FILE'],
     281                   'TITLE' => $TITLE,
     282                  'LEVEL' =>  $current[$j]['LEVEL'],
     283                  'FILE_SRC' => $current[$j]['FILE_SRC'],
     284                  'U_EDIT' => $current[$j]['U_EDIT'],
    278285                  'lat'  =>    $image['lat']    ,
    279286                  'lon' =>     $image['lon']    ,
    280                   'alt' =>     $image['alt']    ,               
    281                   'TN_SRC' => get_thumbnail_url($image),
    282                   'TITLE' => get_thumbnail_title($image,$name,$desc),
    283                   'U_EXIF' => $v_exif,
    284                   'U_BD' =>  $v_db ,
    285                   'U_MAP' => cl_make_map_picture_url(
    286                                                 array(
    287                                                       'image_id'=>$image['id'],
    288                                                       'image_file'=>$image['file'],
    289                                                       )
    290                                                     )
    291                         )
    292                   );
    293            
     287                  'alt' =>     $image['alt']    ,   
     288                  'U_EXIF' => $v_exif ,
     289                  'U_BD' =>  $v_db 
     290                   );
     291             
     292     
    294293      $thumbnails[]=$tpl_var; 
    295294      $j++;
     
    339338
    340339  if (isset($collection)) {
     340  /*********************************
     341  * Affichage de la selection
     342  *********************************/
    341343    $init_info =true;
    342344    $first_image="";
     
    454456
    455457  //=======================================================================
     458
     459$v1=0;
     460
     461
     462}
     463
     464if ($info_message!="")
     465$template->assign('infos',$info_message);
     466if ($erreur_message!="")
     467$template->assign('errors',$erreur_message);
     468
    456469function cl_make_map_picture_url($params)
    457470{
     
    462475    return add_url_params($map_url, array('map'=>null) );
    463476}
    464 $v1=0;
    465 
    466 
    467 
    468 
    469 if ($info_message!="")
    470 $template->assign('infos',$info_message);
    471 if ($erreur_message!="")
    472 $template->assign('errors',$erreur_message);
    473 
    474 
    475477?>
Note: See TracChangeset for help on using the changeset viewer.