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

Location:
extensions/edit_gmaps
Files:
1 deleted
6 edited

Legend:

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

    r17761 r17776  
    1010  $page['tab'] = $_GET['tab'];
    1111
     12   $page['tab'] = 'edit';
    1213$my_base_url = get_admin_plugin_menu_link(__FILE__);
    1314
    14 $tabsheet = new tabsheet();
    15 $tabsheet->add( 'edit', 'edit', add_url_params( $my_base_url, array('tab'=>'edit') ) );
    16 $tabsheet->select($page['tab']);
    17 $tabsheet->assign();
    18 $my_base_url = $tabsheet->sheets[ $page['tab'] ]['url'];
    19 $ntpl=dirname(__FILE__).'\\admin_'.$page['tab'].'.tpl' ;
    20 $template->set_filename( 'tab_data', $ntpl );
     15$template->set_filenames(
     16      array('batch_manager_global' => 'batch_manager_global.tpl',       
     17            'tab_data'=> dirname(__FILE__).'\\admin_'.$page['tab'].'.tpl'
     18            ));
     19
     20         
     21
    2122include_once( dirname(__FILE__).'/admin_'.$page['tab'].'.php');
     23$template->assign_var_from_handle( 'BATCH_MANAGER_GLOBAL', 'batch_manager_global');
    2224$template->assign_var_from_handle( 'TAB_DATA', 'tab_data');
     25$current  =  $template->get_template_vars('BATCH_MANAGER_GLOBAL'); 
     26    $template->concat('TAB_DATA', $current); 
     27
     28
     29
     30
    2331$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
    2432?>
  • 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?>
  • extensions/edit_gmaps/admin/admin_edit.tpl

    r17761 r17776  
    4040 border:outset;
    4141}
     42.thumbLegend { color:grey;
     43
     44}
     45.thumbLegend:hover { color:white ;
     46
     47}
    4248{/literal}
    4349</style>
    4450{/html_head}
    4551 {$file_name} 
    46  <fieldset  id="Elements"  class="fieldset" >
    47 {include file= $GLOBAL_TPL}
    48 </fieldset>
    4952 <script type="text/javascript">
    5053   {if empty($Selectthumbnails)  }   
     
    5457   {/if}
    5558    </script>
    56 {footer_script}{literal}
     59{footer_script}
     60
     61var  infos_img = infos_img || [];
     62        {foreach from=$thumbnails item=thumbnail}
     63  infos_img[{$thumbnail.ID}]={ldelim}EXIF:"{$thumbnail.U_EXIF}",
     64                              BD:"{$thumbnail.U_BD}",
     65                              lon:"{$thumbnail.lon}",
     66                              lat:"{$thumbnail.lat}",
     67                              alt:"{$thumbnail.alt}"
     68                              };
     69             
     70      {/foreach}
     71
     72
     73{literal}
    5774 
    58 jQuery(document).ready(function() {
    59    
    60 
    61 
     75jQuery(document).ready(function() { 
    6276    {/literal}
    63     val0="{'reset'|@translate}";
    64         jQuery('input[value='+val0+']').click(function (i) {ldelim}
    65     jQuery("#selectNone").click();
    66   });
    67 
    6877   title="{'selection'|@translate}|{'hlp_line3'|@translate}.";   
    6978   value="{'selection'|@translate}" ;
    70 
    7179   message='<p><input class="cluetip submit" type="submit" name="submit"   title="'+ title +'" value="'+ value +'"  /> ';
    7280
     
    7684
    7785});
     86
    7887{/footer_script}
    79 <form action="" method="post" id="Envoie" name="Envoie"   >
    80 
    81 <fieldset   id ="geoposition"  class="fieldset" >
     88<form action="" method="post" id="Envoie" name="Envoie" >
     89
     90<fieldset   id ="geoposition"  class="fieldset" style="display:none"  >
    8291<legend>{'Selection'|@translate}</legend> 
    8392    <fieldset>   
  • extensions/edit_gmaps/admin/header.tpl

    r17761 r17776  
    22{combine_script id="jquery.cluetip" path = $ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.js" require="jquery" }
    33{combine_script id="EDIT_RV_script" load="footer" path=$EDIT_CL_PATH|@cat:"admin/js/JScript.js" require="jquery"}
    4 {combine_script id="fieldset" load="footer" path=$EDIT_CL_PATH|@cat:"admin/js/fieldset.js" require="jquery"}
  • extensions/edit_gmaps/admin/js/JScript.js

    r17761 r17776  
    1 
     1if (typeof console=="undefined") {
     2  console = function (i) {
     3
     4  }
     5  console.log = function () {
     6
     7  }
     8}
    29if (!window.log) {
    310  window.log = function () {
     
    1825
    1926jQuery(document).ready(function () {
    20   jQuery('input').click(function (i) {
    21 
    22 
    23   });
    24 
    25   jQuery("#selectNone").click(function (i) {
    26     no_affiche = "false";
    27     if (no_affiche != "true") {
    28       ef_reduce("geoposition", { fast: true })
    29      
     27
     28  jQuery("#geoposition").each(function (i) {
     29    if (no_affiche == "false") {
     30      jQuery(this).hide();
    3031    } else {
    31       ef_reduce("Elements", { fast: true })
    32     }
    33 
    34     jQuery("#selectNone").css("color", "blue");
    35 
    36 
    37   });
    38   jQuery("#selectNone1").click(function (i) {
    39     no_affiche = "true";
    40     jQuery("#selectNone").css("color", "red");
    41     jQuery("#selectNone").click();
    42 
    43   });
     32      jQuery(this).show();
     33    }
     34  });
     35
    4436
    4537  jQuery(".thumbnails label").each(function (i) {
    4638    var wrap2 = jQuery(this).children(".wrap2");
    47     wrap2.append("<span class='thumbLegend'> </span>");
    48   });
    49   jQuery("filedset").each(function (i) {
    50 
    51 
    52   });
    53 
    54   jQuery(".thumbnails label").each(function (i) {
    55     var wrap2 = jQuery(this).children(".wrap2");
    56 
    57   });
     39    win_id = jQuery(this).children("input").val();
     40    if (win_id) {
     41      winp = infos_img[win_id];
     42      if (!winp) return;
     43      message = "";
     44      if (winp.EXIF && winp.EXIF != "NO") message = winp.EXIF.toString() + " ";
     45      if (winp.BD && winp.BD != "NO") message += winp.BD.toString();
     46
     47      wrap2.append("<div><span class='thumbLegend'  id='" + win_id + "'>" + message + " </span></div>");
     48    }
     49  });
     50
     51  jQuery(".thumbLegend").mouseover(function (i) {
     52    winp = infos_img[this.id];
     53    if (!winp) return;
     54    message = "";
     55    if (winp.lat) message = winp.lat.toString() + " ";
     56    if (winp.lon) message += winp.lon.toString();
     57
     58    jQuery(this).text(message);
     59
     60  });
     61  jQuery(".thumbLegend").mouseout(function (i) {
     62    winp = infos_img[this.id];
     63    if (!winp) return;
     64    message = "";
     65    if (winp.EXIF && winp.EXIF != "NO") message = winp.EXIF.toString() + " ";
     66    if (winp.BD && winp.BD != "NO") message += winp.BD.toString();
     67
     68    jQuery(this).text(message);
     69
     70  });
     71
     72
     73
    5874});
    5975
  • extensions/edit_gmaps/edit_gmaps.inc.php

    r17761 r17776  
    220220return $datas[0] ;
    221221}
    222 //======================================================
    223 /*
    224  *
    225  */
     222
     223/************************************************
     224 * add_data_base
     225 ************************************************/
    226226 static public function add_data_base($sel,$lat,$lon,$alt){
    227227    global $page,$info_message,$erreur_message ;
Note: See TracChangeset for help on using the changeset viewer.