[12126] | 1 | <?php |
---|
[4545] | 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
[25488] | 3 | |
---|
[4545] | 4 | load_language('lang', dirname(__FILE__).'/../'); |
---|
| 5 | $admin_url = PHPWG_ROOT_PATH.'admin.php'; |
---|
| 6 | |
---|
[12126] | 7 | |
---|
[9377] | 8 | /***********************************************************************************/ |
---|
[10060] | 9 | if (!defined('TOOL_KIT_PATH')) define( 'TOOL_KIT_PATH', EDIT_CL_PATH."admin/"); |
---|
[12126] | 10 | if (!defined('INCLUDE_PATH')) define( 'INCLUDE_PATH', TOOL_KIT_PATH.'include/' ); |
---|
[9412] | 11 | |
---|
[12126] | 12 | $Toolkit_Dir =INCLUDE_PATH ; |
---|
[9412] | 13 | |
---|
[12126] | 14 | include $Toolkit_Dir . 'fonctions.php'; |
---|
| 15 | //========================================================== |
---|
| 16 | if (!defined('EDIT_CL_PATH')) define( 'EDIT_CL_PATH', EDIT_CL_PATH .'admin/' ); |
---|
| 17 | $path = EDIT_CL_PATH; |
---|
| 18 | $plg_data = implode( '', file($path.'main.inc.php') ); |
---|
[22117] | 19 | if (preg_match("|Version: (.*)|", $plg_data, $val)) { |
---|
| 20 | $EDIT_CL_PATH_plugin['version'] = trim($val[1]); |
---|
[12126] | 21 | } |
---|
| 22 | $EDIT_CL_PATH_plugin = array_map('htmlspecialchars', $EDIT_CL_PATH_plugin); |
---|
| 23 | $version= $EDIT_CL_PATH_plugin['version'] ; |
---|
| 24 | $icon_path = 'themes/default/icon/help.png'; |
---|
| 25 | $path_js= 'themes/default/js/' ; |
---|
[22117] | 26 | |
---|
| 27 | |
---|
[17761] | 28 | $global_tpl=realpath(PHPWG_ROOT_PATH).'\\admin\\themes\\default\\template\\batch_manager_global.tpl' ; |
---|
| 29 | |
---|
| 30 | $template->assign( |
---|
[22117] | 31 | array( 'EDIT_CL_PATH' => EDIT_CL_PATH, |
---|
| 32 | 'path_js' => $path_js, |
---|
| 33 | 'VERSION'=> $version, |
---|
| 34 | 'EDIT_CL_PATH_ABS' => dirname(__FILE__).'/', |
---|
| 35 | 'GLOBAL_TPL' => $global_tpl |
---|
| 36 | ) |
---|
| 37 | ); |
---|
[17761] | 38 | |
---|
[10060] | 39 | /****************************************************************/ |
---|
[12126] | 40 | $info_message="" ; |
---|
[22117] | 41 | $erreur_message=""; |
---|
[12126] | 42 | /****************************************************************/ |
---|
[17761] | 43 | if ( !isset($_GET['mode']) ) $_GET['mode'] = 'global'; |
---|
[18635] | 44 | |
---|
| 45 | // if(!isset($_GET['cat'])) $_GET['cat']=" " ; |
---|
[17761] | 46 | if(isset($_POST['filter_prefilter'])){ |
---|
[22117] | 47 | $_GET['cat'] = $_POST['filter_prefilter']; |
---|
[17761] | 48 | } |
---|
[22117] | 49 | |
---|
[17761] | 50 | if (!isset($page['title'])) $page['title']=""; |
---|
| 51 | if(!isset($_POST['selectAction'])) $_POST['selectAction']="" ; |
---|
[18635] | 52 | |
---|
[17776] | 53 | //========== Mode GLOBAL ================================ |
---|
[18635] | 54 | |
---|
[20034] | 55 | |
---|
[17761] | 56 | check_input_parameter('selection', $_POST, true, PATTERN_ID); |
---|
[22117] | 57 | include (PHPWG_ROOT_PATH.'admin/batch_manager.php'); |
---|
| 58 | $tabsheet = new tabsheet(); |
---|
| 59 | $tabsheet->assign(); |
---|
[17761] | 60 | |
---|
[22117] | 61 | if(isset($page['cat_elements_id'])) |
---|
| 62 | $template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d image', '%d images', count($page['cat_elements_id'])).' - '.$page['title']); |
---|
[17761] | 63 | |
---|
[20034] | 64 | |
---|
[22117] | 65 | if(isset($_POST)){ |
---|
| 66 | // $info_message .= cl_print_var($_POST); |
---|
| 67 | //=============================================================== |
---|
| 68 | $collection = array(); |
---|
| 69 | if(isset($_POST['selection'])) |
---|
| 70 | $collection = $_POST['selection']; |
---|
| 71 | //=============================================================== |
---|
| 72 | $images=array(); |
---|
| 73 | if (!empty($_GET['display'])){ |
---|
| 74 | if ('all' == $_GET['display']) |
---|
| 75 | $page['nb_images'] = count($page['cat_elements_id']); |
---|
| 76 | else |
---|
| 77 | $page['nb_images'] = intval($_GET['display']); |
---|
| 78 | } |
---|
| 79 | else |
---|
| 80 | $page['nb_images'] = 20; |
---|
[9412] | 81 | |
---|
[22117] | 82 | if ( !empty($page['cat_elements_id']) ){ |
---|
| 83 | $query=' |
---|
| 84 | SELECT * FROM '.IMAGES_TABLE.' |
---|
| 85 | WHERE id IN ('.implode(',',$page['cat_elements_id']).') |
---|
| 86 | '.$conf['order_by'].' |
---|
| 87 | LIMIT '.$page['start'].', '. $page['nb_images'] .' |
---|
| 88 | ;'; |
---|
| 89 | $result = pwg_query($query); |
---|
[22121] | 90 | while ( $row=pwg_db_fetch_assoc($result) ) |
---|
[22117] | 91 | $images[] = $row; |
---|
[17761] | 92 | |
---|
[22117] | 93 | } |
---|
| 94 | //=============================================================== |
---|
| 95 | global $lang_info; |
---|
| 96 | if (date_default_timezone_get()) { |
---|
| 97 | $adresse = date_default_timezone_get() ; |
---|
| 98 | }else{ |
---|
[9412] | 99 | |
---|
[22117] | 100 | } |
---|
| 101 | $adresse = $lang_info['country']; ; |
---|
| 102 | $adresse=str_replace("/",", ",$adresse); |
---|
| 103 | global $EDIT_CL_parametres ; |
---|
[20034] | 104 | |
---|
[22117] | 105 | $EDIT_CL_parametres = cl_edit_controler::cl_edit_Get_Options(); |
---|
[20034] | 106 | |
---|
[12126] | 107 | |
---|
[22117] | 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 | ); |
---|
[12126] | 117 | |
---|
[22117] | 118 | if (count($collection)>0 ) |
---|
| 119 | if ( isset($_POST['update']) && ( $_POST['update']==l10n('update_exif') || $_POST['update'] == l10n('update_all') )){ |
---|
| 120 | /*********************************** |
---|
| 121 | * Mise à jour des meta données |
---|
| 122 | ************************************/ |
---|
| 123 | // error_reporting ( 0 ); |
---|
| 124 | // Hide any unknown EXIF tags |
---|
| 125 | $GLOBALS['HIDE_UNKNOWN_TAGS'] = FALSE; |
---|
| 126 | include $Toolkit_Dir.'Toolkit_Version.php'; // Change: added as of version 1.11 |
---|
| 127 | // Include the required files for reading and writing Photoshop File Info |
---|
| 128 | include $Toolkit_Dir.'JPEG.php'; |
---|
| 129 | include $Toolkit_Dir.'XMP.php'; |
---|
| 130 | include $Toolkit_Dir.'Photoshop_IRB.php'; |
---|
| 131 | include $Toolkit_Dir.'EXIF.php'; |
---|
| 132 | include $Toolkit_Dir.'GPS_File_Info.php'; |
---|
[12126] | 133 | |
---|
[22117] | 134 | $GLOBALS['HTTP_POST_VARS']=$_POST ; |
---|
| 135 | // Copy all of the HTML Posted variables into an array |
---|
| 136 | $new_ps_file_info_array = $GLOBALS['HTTP_POST_VARS']; |
---|
[17779] | 137 | |
---|
[22117] | 138 | // Some characters are escaped with backslashes in HTML Posted variable |
---|
| 139 | // Cycle through each of the HTML Posted variables, and strip out the slashes ' |
---|
[18635] | 140 | |
---|
[22117] | 141 | foreach( $new_ps_file_info_array as $var_key => $var_val ){ |
---|
| 142 | if ($var_key !="selection") |
---|
| 143 | $new_ps_file_info_array[ $var_key ] = stripslashes( $var_val ); |
---|
| 144 | } |
---|
[17779] | 145 | |
---|
[22117] | 146 | $init_info =true; |
---|
| 147 | $first_image=""; |
---|
| 148 | |
---|
| 149 | foreach ($collection as $id_0){ |
---|
| 150 | foreach ($images as $image) { |
---|
| 151 | if (array_search($id_0,$image)) { |
---|
| 152 | //================================================================= |
---|
| 153 | // Meta donnée |
---|
| 154 | //================================================================= |
---|
[18635] | 155 | |
---|
[22117] | 156 | $lat =(isset($_POST['lat']) && $_POST['lat'] )!='' ?trim($_POST['lat']):$image['lat']; |
---|
| 157 | $lon = (isset($_POST['lon']) && $_POST['lon'] )!='' ?trim($_POST['lon']):$image['lon']; |
---|
| 158 | $alt =(isset($_POST['alt']) && $_POST['alt'] )!=''?trim($_POST['alt']):$image['alt']; |
---|
[18635] | 159 | |
---|
[22117] | 160 | //========== Mise à jour $image ============= |
---|
| 161 | $image['lat']=$lat; |
---|
| 162 | $image['lon']=$lon; |
---|
| 163 | $image['alt']=$alt; |
---|
| 164 | //==== lecture info gps ==== |
---|
| 165 | $infos_gps = array(); |
---|
| 166 | if ( isset($_POST['lat']) && $_POST['lat'] !=''){ |
---|
| 167 | } else{ |
---|
| 168 | $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,true) ; |
---|
| 169 | if($infos_gps['lat']!=0){ |
---|
| 170 | $image['lat']=$infos_gps['lat']; |
---|
| 171 | $image['lon']=$infos_gps['lon']; |
---|
| 172 | } |
---|
| 173 | } |
---|
| 174 | $new_ps_file_info_array = base_to_meta($image); |
---|
[18635] | 175 | |
---|
[22117] | 176 | $new_ps_file_info_array['filename'] = $image['path']; |
---|
| 177 | $new_ps_file_info_array['selection'] = explode(";",$new_ps_file_info_array['filename']); |
---|
[18635] | 178 | |
---|
[22117] | 179 | if( $image['lat']=="" ){ |
---|
| 180 | $image['lat']= $new_ps_file_info_array['lat'] ; |
---|
| 181 | $image['lon']= $new_ps_file_info_array['lon'] ; |
---|
| 182 | $image['alt']= $new_ps_file_info_array['alt'] ; |
---|
| 183 | } |
---|
[18635] | 184 | |
---|
| 185 | |
---|
| 186 | |
---|
| 187 | |
---|
[22117] | 188 | if( cl_edit_controler::add_meta_gps($new_ps_file_info_array,$image)){ |
---|
| 189 | $exif = @read_exif_data( $image['path']); |
---|
| 190 | $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,true) ; |
---|
| 191 | $info_message .=l10n('update_exif') . " : " . $image['path'] . " : " . $image['file'] . " : ok<BR />"; |
---|
| 192 | } |
---|
[18635] | 193 | |
---|
[22117] | 194 | }else{ |
---|
| 195 | |
---|
| 196 | } // fin search |
---|
[10060] | 197 | |
---|
[22117] | 198 | } // fin id_0 |
---|
[10060] | 199 | |
---|
[18635] | 200 | |
---|
[12126] | 201 | |
---|
[22117] | 202 | } // fin collection |
---|
[10060] | 203 | |
---|
[22117] | 204 | if($_POST['update']==l10n('update_exif')) { |
---|
| 205 | unset($_POST['submit']); |
---|
| 206 | } |
---|
| 207 | if ($_POST['update']==l10n('update_all')){ |
---|
| 208 | $_POST['submit'] = l10n('update_database') ; |
---|
[20034] | 209 | |
---|
[22117] | 210 | } |
---|
[20034] | 211 | |
---|
[22117] | 212 | $_POST['update'] ="ok"; |
---|
[17761] | 213 | |
---|
[22117] | 214 | } |
---|
| 215 | //====================================================================== |
---|
| 216 | if ( isset($_POST['submit']) ) { |
---|
| 217 | if ( $_POST['submit'] == l10n('update_database') ){ |
---|
| 218 | /************************************************** |
---|
| 219 | * Uniquement Mise à jour de la base de données |
---|
| 220 | **************************************************/ |
---|
| 221 | if ( count($collection)>0 ){ |
---|
| 222 | $lat = trim($_POST['lat']); |
---|
| 223 | $lon = trim($_POST['lon']); |
---|
| 224 | $alt = trim($_POST['alt']); |
---|
| 225 | //=============================================================== |
---|
| 226 | if($lat !="") cl_edit_controler::add_data_base($collection,$lat,$lon,$alt) ; |
---|
| 227 | $_POST['submit'] = l10n('selectAction') ; |
---|
| 228 | unset($_POST['submit']); |
---|
| 229 | foreach ($collection as $id_0){ |
---|
| 230 | foreach ($images as $image) { |
---|
| 231 | if (array_search($id_0,$image)) { |
---|
| 232 | $image['lat'] = $lat ; |
---|
| 233 | $image['lon']= $lon ; |
---|
| 234 | $image['alt'] = $alt ; |
---|
| 235 | } |
---|
| 236 | } |
---|
| 237 | } |
---|
| 238 | } |
---|
| 239 | $_POST['submit'] = l10n('selectAction') ; |
---|
| 240 | unset($_POST['submit']); |
---|
| 241 | } |
---|
| 242 | } |
---|
| 243 | /****************************************/ |
---|
| 244 | $query = ' |
---|
| 245 | SELECT id,name,uppercats,global_rank |
---|
| 246 | FROM '.CATEGORIES_TABLE.' |
---|
| 247 | ;'; |
---|
| 248 | $result = pwg_query($query); |
---|
| 249 | $categories = array(); |
---|
| 250 | $selecteds = array(); |
---|
| 251 | if(!isset($_GET['cat'])) $_GET['cat']="tag-no"; |
---|
| 252 | if (!empty($result)){ |
---|
[22121] | 253 | while ($row = pwg_db_fetch_assoc($result)) { |
---|
[22117] | 254 | $url = $admin_url.get_query_string_diff(array('start','cat')).'&cat='.$row['id']; |
---|
[17779] | 255 | |
---|
[22117] | 256 | if ( $row['id']==$_GET['cat'] ) $selecteds[] = $url; |
---|
| 257 | $row['id']=$url; |
---|
| 258 | |
---|
| 259 | array_push($categories, $row); |
---|
| 260 | } |
---|
| 261 | } |
---|
[20034] | 262 | |
---|
[22117] | 263 | usort($categories, 'global_rank_compare'); |
---|
| 264 | display_select_categories($categories, $selecteds, 'categories', false); |
---|
[20034] | 265 | |
---|
| 266 | |
---|
[22117] | 267 | if ( !empty($page['cat_elements_id']) ){ |
---|
| 268 | $nav_bar = create_navigation_bar( |
---|
| 269 | $admin_url.get_query_string_diff(array('start')), |
---|
| 270 | count($page['cat_elements_id']), |
---|
| 271 | $page['start'], |
---|
| 272 | $page['nb_images'] |
---|
| 273 | ); |
---|
| 274 | $template->assign('navbar', $nav_bar); |
---|
| 275 | } |
---|
| 276 | //======================================================================== |
---|
| 277 | $v_exif=""; |
---|
| 278 | $current = $template->get_template_vars('thumbnails'); |
---|
| 279 | $j=0; |
---|
| 280 | $thumbnails= array(); |
---|
| 281 | /************************************* |
---|
| 282 | * AFFICHAGE MODE GLOBAL |
---|
| 283 | *************************************/ |
---|
[20034] | 284 | |
---|
[22117] | 285 | foreach ($images as $image){ |
---|
| 286 | $infos_gps = array(); |
---|
| 287 | $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,false) ; |
---|
[20034] | 288 | |
---|
[22117] | 289 | $v_exif=$infos_gps['is_exif']?"EXIF":"NO" ; |
---|
| 290 | $v_db=false ; |
---|
| 291 | $v_db=$image['lat']!=0 && $image['lon']!=0; |
---|
| 292 | $v_db=$v_db?"BD":"NO"; |
---|
| 293 | //==== GPS infos -> image infos ==== |
---|
| 294 | if( $infos_gps['lat'] !=0 || $infos_gps['lon'] !=0 ) { |
---|
| 295 | $new= ( !isset($image['lat'])? true: $image['lat']!=$infos_gps['lat'] ) ; |
---|
| 296 | $image['lat']=$infos_gps['lat']; |
---|
| 297 | $image['lon']=$infos_gps['lon']; |
---|
| 298 | $image['alt']=$infos_gps['alt']; |
---|
| 299 | $sel_img= array($image['id']); |
---|
| 300 | if ($new){ |
---|
| 301 | cl_edit_controler::add_data_base( $sel_img,$image['lat'],$image['lon'],$image['alt']) ; |
---|
| 302 | } |
---|
| 303 | } |
---|
| 304 | //================================================= |
---|
| 305 | $name = render_element_name($image); |
---|
| 306 | $desc = render_element_description($image); |
---|
| 307 | if (!in_array($image['id'],$current[$j])) { |
---|
| 308 | $j =0; |
---|
| 309 | foreach($current as $rK => $rV){ |
---|
| 310 | if (!in_array($image['id'],$rV)) { |
---|
| 311 | $j++ ; |
---|
| 312 | } else{ |
---|
| 313 | // $info_message .= cl_print_var($current[$j]); |
---|
| 314 | break ; |
---|
| 315 | } |
---|
| 316 | } |
---|
| 317 | } |
---|
| 318 | //================================================= |
---|
[17779] | 319 | |
---|
[22117] | 320 | $TN_SRC= $current[$j]['thumb']; |
---|
| 321 | $TITLE=$current[$j]['TITLE'] ; |
---|
[9377] | 322 | |
---|
[22117] | 323 | $tpl_var = array( |
---|
| 324 | 'id' =>$image['id'], |
---|
| 325 | 'TN_SRC' => $TN_SRC, |
---|
| 326 | 'file' => $current[$j]['FILE'], |
---|
| 327 | 'TITLE' => $TITLE, |
---|
| 328 | 'LEVEL' => $current[$j]['LEVEL'], |
---|
| 329 | 'FILE_SRC' => $current[$j]['FILE_SRC'], |
---|
| 330 | 'U_EDIT' => $current[$j]['U_EDIT'], |
---|
| 331 | 'lat' => $image['lat'] , |
---|
| 332 | 'lon' => $image['lon'] , |
---|
| 333 | 'alt' => $image['alt'] , |
---|
| 334 | 'U_EXIF' => $v_exif , |
---|
| 335 | 'U_BD' => $v_db , |
---|
| 336 | 'thumb' =>$current[$j]['thumb'] |
---|
| 337 | ); |
---|
| 338 | |
---|
| 339 | |
---|
| 340 | $thumbnails[]=$tpl_var; |
---|
| 341 | $j++; |
---|
| 342 | } |
---|
| 343 | |
---|
| 344 | $template->assign('thumbnails', $thumbnails); |
---|
[9377] | 345 | |
---|
| 346 | |
---|
[22117] | 347 | $template->assign( |
---|
| 348 | array( |
---|
| 349 | 'U_DISPLAY'=> $admin_url.get_query_string_diff(array('display')) |
---|
| 350 | ) |
---|
| 351 | ); |
---|
[4545] | 352 | |
---|
[22117] | 353 | //================================================================================== |
---|
| 354 | $match=""; |
---|
| 355 | if ( isset($_POST['submit']) ) { |
---|
| 356 | if ( isset($_POST['match']) && $_POST['match']!='' ){ |
---|
| 357 | cl_edit_controler::cl_edit_Set_Options(); |
---|
| 358 | cl_edit_controler::cl_edit_sauve_options_inf(); |
---|
| 359 | } |
---|
| 360 | if ($_POST['submit']==l10n('selection') ) { |
---|
| 361 | $collection =$_POST['selection']; |
---|
| 362 | } |
---|
[9377] | 363 | |
---|
[22117] | 364 | if ($_POST['submit']==l10n('add') ) { |
---|
| 365 | $_POST['selection']=array(); |
---|
| 366 | $collection =array(); |
---|
| 367 | unset($collection); |
---|
| 368 | } |
---|
| 369 | if ($_POST['submit']==l10n('reset' ) ) { |
---|
| 370 | $_POST['selection']=array(); |
---|
| 371 | $collection =array(); |
---|
| 372 | unset($collection); |
---|
| 373 | } |
---|
| 374 | } |
---|
| 375 | //================================================================================= |
---|
| 376 | $src=""; |
---|
[17776] | 377 | |
---|
[22117] | 378 | //====================================================================== |
---|
| 379 | if (isset($_POST['submit']) and $_POST['submit']==l10n('selection' )){ |
---|
| 380 | $collection=$_POST['selection'] ; |
---|
[9377] | 381 | |
---|
[22117] | 382 | if (isset($collection)) { |
---|
| 383 | /********************************* |
---|
| 384 | * Affichage de la selection |
---|
| 385 | *********************************/ |
---|
| 386 | $init_info =true; |
---|
| 387 | $first_image=""; |
---|
| 388 | $_POST['selection'] = $collection ; |
---|
| 389 | foreach ($collection as $id_0) { |
---|
| 390 | foreach ($images as $image) { |
---|
| 391 | if (array_search($id_0,$image)) { |
---|
[9377] | 392 | |
---|
[22117] | 393 | $infos_gps = array(); |
---|
| 394 | $infos_gps =array(); |
---|
| 395 | $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,false) ; |
---|
| 396 | |
---|
| 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']){ |
---|
| 402 | $image['lat']=$infos_gps['lat']; |
---|
| 403 | $image['lon']=$infos_gps['lon']; |
---|
| 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 | } |
---|
| 412 | //========================================== |
---|
| 413 | if ( $init_info && $image['lat'] <> '' ) { |
---|
| 414 | $init_info = false ; |
---|
| 415 | //===================================================== |
---|
| 416 | $template->assign( 'coordinates', |
---|
| 417 | array( |
---|
| 418 | 'FILE' => $image['path'], |
---|
| 419 | 'LAT' => $lat , |
---|
| 420 | 'LON' => $lon , |
---|
| 421 | 'ADRESSE' => $adresse , |
---|
| 422 | 'ZOOM' => 4, |
---|
| 423 | 'ALT' => $alt , |
---|
| 424 | ) |
---|
| 425 | ); |
---|
| 426 | } |
---|
| 427 | //===================================================== |
---|
| 428 | $lonDMS= dec2dms($lon) ; |
---|
| 429 | $latDMS= dec2dms($lat) ; |
---|
| 430 | $v_db=false ; |
---|
| 431 | $v_db=$lon!=0 && $lat!=0; |
---|
| 432 | |
---|
| 433 | $tpl_var = array_merge( |
---|
| 434 | $image, |
---|
| 435 | array( |
---|
| 436 | 'filename' => $image['path'], |
---|
| 437 | 'exif' => '"'.$infos_gps['is_exif'].'"' , |
---|
| 438 | 'lat' => $image['lat'] , |
---|
| 439 | 'lon' => $image['lon'] , |
---|
| 440 | 'alt' => $image['alt'] , |
---|
| 441 | 'latDMS' => $latDMS[3] , |
---|
| 442 | 'lonDMS' => $lonDMS[3] , |
---|
| 443 | 'adresse' => $adresse , |
---|
| 444 | 'TN_SRC' => DerivativeImage::thumb_url($image), |
---|
| 445 | 'TITLE' => render_element_name($image), |
---|
| 446 | 'U_EXIF' => $infos_gps['is_exif'] , |
---|
| 447 | 'U_BD' => $v_db , |
---|
| 448 | 'U_MAP' => cl_make_map_picture_url( |
---|
| 449 | array( |
---|
| 450 | 'image_id'=>$image['id'], |
---|
| 451 | 'image_file'=>$image['file'], |
---|
| 452 | ) |
---|
| 453 | ), |
---|
| 454 | ) |
---|
| 455 | ); |
---|
| 456 | $template->append('Selectthumbnails', $tpl_var); |
---|
| 457 | } |
---|
| 458 | } |
---|
| 459 | } |
---|
| 460 | } |
---|
| 461 | } |
---|
| 462 | |
---|
| 463 | //============================================================ |
---|
| 464 | if ( !empty($first_image)) { |
---|
| 465 | $erreur_message .= cl_print_var($first_image); |
---|
| 466 | |
---|
| 467 | if (isset($_POST['update'])) { |
---|
| 468 | // document.Envoie.latDMS.value |
---|
| 469 | $image= first_image ; |
---|
| 470 | $filename=$image['path'] ; |
---|
| 471 | $Val_exif=""; |
---|
| 472 | $Val_XMP=""; |
---|
| 473 | /* */ |
---|
| 474 | if (!empty($infos_gps)) |
---|
| 475 | $Position = $infos_gps ; |
---|
| 476 | else |
---|
| 477 | $Position = cl_edit_controler::Get_exif_gps($filename,$image,false,true) ; |
---|
| 478 | |
---|
| 479 | $jpeg_header_data = get_jpeg_header_data($filename ); |
---|
| 480 | $template->assign( array( |
---|
| 481 | 'filename_abs' => $filename , |
---|
| 482 | 'filename' => $filename, |
---|
| 483 | 'datas' => array( |
---|
| 484 | /* |
---|
| 485 | 'Val_JPEG_APP'=> Generate_JPEG_APP_Segment_HTML( $jpeg_header_data ), |
---|
| 486 | 'Val_intrinsic'=> Interpret_intrinsic_values_to_HTML( get_jpeg_intrinsic_values( $jpeg_header_data ) ), |
---|
| 487 | 'Val_Comment'=> Interpret_Comment_to_HTML( $jpeg_header_data ), |
---|
| 488 | 'Val_JFIF'=> Interpret_JFIF_to_HTML( get_JFIF( $jpeg_header_data ), $filename ), |
---|
| 489 | 'Val_JFXX'=>Interpret_JFXX_to_HTML( get_JFXX( $jpeg_header_data ), $filename ), |
---|
| 490 | 'Val_App12' => Interpret_App12_Pic_Info_to_HTML( $jpeg_header_data ), |
---|
| 491 | 'Val_IRB' => Interpret_IRB_to_HTML( get_Photoshop_IRB( $jpeg_header_data ), $filename ), |
---|
| 492 | |
---|
| 493 | 'Val_exif'=> Interpret_EXIF_to_HTML( get_EXIF_JPEG( $filename ), $filename), |
---|
| 494 | 'Val_XMP' => Interpret_XMP_to_HTML( read_XMP_array_from_text( get_XMP_text( $jpeg_header_data) ) ), |
---|
| 495 | */ |
---|
| 496 | // |
---|
| 497 | ), |
---|
| 498 | 'Datadase' => ($Position) , |
---|
| 499 | ) ); |
---|
| 500 | } |
---|
| 501 | } |
---|
| 502 | |
---|
| 503 | |
---|
| 504 | //======================================================================= |
---|
| 505 | |
---|
| 506 | $v1=0; |
---|
| 507 | |
---|
| 508 | |
---|
[17776] | 509 | } |
---|
[9412] | 510 | |
---|
[12126] | 511 | if ($info_message!="") |
---|
[22117] | 512 | $template->assign('infos',$info_message); |
---|
[12126] | 513 | if ($erreur_message!="") |
---|
[22117] | 514 | $template->assign('errors',$erreur_message); |
---|
[9412] | 515 | |
---|
[17776] | 516 | function cl_make_map_picture_url($params) |
---|
| 517 | { |
---|
[22117] | 518 | global $conf; |
---|
| 519 | /*if ( empty($conf['gmaps_api_key']) and $_SERVER['SERVER_ADDR']!='127.0.0.1' ) |
---|
| 520 | return "";*/ |
---|
| 521 | $map_url = make_picture_url($params); |
---|
| 522 | return add_url_params($map_url, array('map'=>null) ); |
---|
[17776] | 523 | } |
---|
[9412] | 524 | ?> |
---|