Changeset 17776 for extensions/edit_gmaps
- Timestamp:
- Sep 6, 2012, 1:11:45 PM (12 years ago)
- Location:
- extensions/edit_gmaps
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/edit_gmaps/admin/admin.php
r17761 r17776 10 10 $page['tab'] = $_GET['tab']; 11 11 12 $page['tab'] = 'edit'; 12 13 $my_base_url = get_admin_plugin_menu_link(__FILE__); 13 14 14 $t absheet = 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 21 22 include_once( dirname(__FILE__).'/admin_'.$page['tab'].'.php'); 23 $template->assign_var_from_handle( 'BATCH_MANAGER_GLOBAL', 'batch_manager_global'); 22 24 $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 23 31 $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); 24 32 ?> -
extensions/edit_gmaps/admin/admin_edit.php
r17761 r17776 48 48 if (!isset($page['title'])) $page['title']=""; 49 49 if(!isset($_POST['selectAction'])) $_POST['selectAction']="" ; 50 51 50 //$info_message .= cl_edit_functions::Memo_Vars($_POST); 51 //========== Mode GLOBAL ================================ 52 52 check_input_parameter('selection', $_POST, true, PATTERN_ID); 53 54 53 include (PHPWG_ROOT_PATH.'admin/batch_manager.php'); 54 $tabsheet = new tabsheet(); 55 $tabsheet->assign(); 56 57 58 55 59 56 60 if(isset($page['cat_elements_id'])) … … 58 62 59 63 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); 67 66 68 67 //=============================================================== … … 104 103 105 104 if (count($collection)>0 ) 106 //=============================================================107 105 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 *******************************/ 109 109 // error_reporting ( 0 ); 110 110 // Hide any unknown EXIF tags … … 138 138 if (array_search($id_0,$image)) { 139 139 //================================================================= 140 // Donnée base de donnée141 //=================================================================142 // $info_message .= "<div style='border:2px solid red'>$id_0 Image:" . cl_edit_functions::Memo_vars($image)."</div>" ;143 144 //=================================================================145 140 // Meta donnée 146 141 //================================================================= … … 169 164 170 165 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 />"; 175 169 }else{ 176 170 … … 186 180 //====================================================================== 187 181 if ( isset($_POST['submit']) ) { 188 /******** Mise à jour base de données *****/189 182 if ( $_POST['submit'] == l10n('update_database') ){ 183 /************************************************** 184 * Uniquement Mise à jour de la base de données 185 **************************************************/ 190 186 if ( count($collection)>0 ){ 191 187 $lat = trim($_POST['lat']); … … 195 191 if($lat !="") cl_edit_controler::add_data_base($collection,$lat,$lon,$alt) ; 196 192 $_POST['submit'] = l10n('selectAction') ; 197 193 foreach ($collection as $id_0){ 198 194 foreach ($images as $image) { 199 195 if (array_search($id_0,$image)) { … … 207 203 } 208 204 } 209 210 205 /****************************************/ 211 206 $query = ' … … 245 240 $infos_gps = array(); 246 241 $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" ; 248 243 $v_db=false ; 249 244 $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 ==== 252 247 if( $infos_gps['lat'] !=0 || $infos_gps['lon'] !=0 ) { 253 248 $new= ( !isset($image['lat'])? true: $image['lat']!=$infos_gps['lat'] ) ; … … 256 251 $image['alt']=$infos_gps['alt']; 257 252 $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 } 259 257 } 260 258 //================================================= … … 273 271 } 274 272 //================================================= 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'], 278 285 'lat' => $image['lat'] , 279 286 '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 294 293 $thumbnails[]=$tpl_var; 295 294 $j++; … … 339 338 340 339 if (isset($collection)) { 340 /********************************* 341 * Affichage de la selection 342 *********************************/ 341 343 $init_info =true; 342 344 $first_image=""; … … 454 456 455 457 //======================================================================= 458 459 $v1=0; 460 461 462 } 463 464 if ($info_message!="") 465 $template->assign('infos',$info_message); 466 if ($erreur_message!="") 467 $template->assign('errors',$erreur_message); 468 456 469 function cl_make_map_picture_url($params) 457 470 { … … 462 475 return add_url_params($map_url, array('map'=>null) ); 463 476 } 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 475 477 ?> -
extensions/edit_gmaps/admin/admin_edit.tpl
r17761 r17776 40 40 border:outset; 41 41 } 42 .thumbLegend { color:grey; 43 44 } 45 .thumbLegend:hover { color:white ; 46 47 } 42 48 {/literal} 43 49 </style> 44 50 {/html_head} 45 51 {$file_name} 46 <fieldset id="Elements" class="fieldset" >47 {include file= $GLOBAL_TPL}48 </fieldset>49 52 <script type="text/javascript"> 50 53 {if empty($Selectthumbnails) } … … 54 57 {/if} 55 58 </script> 56 {footer_script}{literal} 59 {footer_script} 60 61 var 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} 57 74 58 jQuery(document).ready(function() { 59 60 61 75 jQuery(document).ready(function() { 62 76 {/literal} 63 val0="{'reset'|@translate}";64 jQuery('input[value='+val0+']').click(function (i) {ldelim}65 jQuery("#selectNone").click();66 });67 68 77 title="{'selection'|@translate}|{'hlp_line3'|@translate}."; 69 78 value="{'selection'|@translate}" ; 70 71 79 message='<p><input class="cluetip submit" type="submit" name="submit" title="'+ title +'" value="'+ value +'" /> '; 72 80 … … 76 84 77 85 }); 86 78 87 {/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" > 82 91 <legend>{'Selection'|@translate}</legend> 83 92 <fieldset> -
extensions/edit_gmaps/admin/header.tpl
r17761 r17776 2 2 {combine_script id="jquery.cluetip" path = $ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.js" require="jquery" } 3 3 {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 1 if (typeof console=="undefined") { 2 console = function (i) { 3 4 } 5 console.log = function () { 6 7 } 8 } 2 9 if (!window.log) { 3 10 window.log = function () { … … 18 25 19 26 jQuery(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(); 30 31 } 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 44 36 45 37 jQuery(".thumbnails label").each(function (i) { 46 38 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 58 74 }); 59 75 -
extensions/edit_gmaps/edit_gmaps.inc.php
r17761 r17776 220 220 return $datas[0] ; 221 221 } 222 //====================================================== 223 /* 224 * 225 * /222 223 /************************************************ 224 * add_data_base 225 ************************************************/ 226 226 static public function add_data_base($sel,$lat,$lon,$alt){ 227 227 global $page,$info_message,$erreur_message ;
Note: See TracChangeset
for help on using the changeset viewer.