Changeset 9412 for extensions/edit_gmaps/admin
- Timestamp:
- Feb 28, 2011, 12:53:47 PM (14 years ago)
- Location:
- extensions/edit_gmaps/admin
- Files:
-
- 27 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/edit_gmaps/admin/admin.php
r9377 r9412 4 4 5 5 $colonnes = cl_get_columns_of(IMAGES_TABLE); 6 7 $key = array_search('lon', $colonnes[IMAGES_TABLE]); 8 if (!$key){ 9 $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `lon` DOUBLE(9,6)'; 10 pwg_query($q); 11 } 12 $key = array_search('lat', $colonnes[IMAGES_TABLE]); 13 if (!$key){ 14 $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `lat` DOUBLE(9,6)'; 15 pwg_query($q); 16 } 6 17 $key = array_search('alt', $colonnes[IMAGES_TABLE]); 7 18 if (!$key){ 8 19 $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `alt` DOUBLE(9,6)'; 9 20 pwg_query($q); 10 } 21 } 22 23 11 24 /** 12 25 * list all columns of each given table -
extensions/edit_gmaps/admin/admin_edit.php
r9377 r9412 4 4 load_language('lang', dirname(__FILE__).'/../'); 5 5 $admin_url = PHPWG_ROOT_PATH.'admin.php'; 6 7 8 6 9 7 if ( !isset($_GET['cat']) ) $_GET['cat'] = 'caddie'; … … 20 18 21 19 /***********************************************************************************/ 22 if (!defined('TOOL_KIT_PATH')) define( 'TOOL_KIT_PATH', EDIT_ RV_PATH."admin/");20 if (!defined('TOOL_KIT_PATH')) define( 'TOOL_KIT_PATH', EDIT_CL_PATH."admin/"); 23 21 if (!defined('INCLUDE_PATH')) define( 'INCLUDE_PATH', TOOL_KIT_PATH.'include/' ); 24 22 $Toolkit_Dir =INCLUDE_PATH ; … … 29 27 30 28 $template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d image', '%d images', count($page['cat_elements_id'])).' - '.$page['title']); 31 32 33 if ( isset($_POST['submit']) ) 34 { 35 $collection = array(); 36 if( !isset ($_POST['target'])) 37 { 38 $_POST['submit'] == l10n('Submit') ; 39 $_POST['target']='selection'; 40 $collection = $_POST['selection']; 41 42 } 43 44 switch ($_POST['target']) 45 { 46 case 'all' : 47 $collection = $page['cat_elements_id']; 48 break; 49 case 'selection' : 50 if (!isset($_POST['selection']) or count($_POST['selection']) == 0) 51 array_push($page['errors'], l10n('Select at least one picture')); 52 else 53 $collection = $_POST['selection']; 54 break; 55 } 56 57 // test si mise à jour (valider) 58 if ( isset($_POST['submit']) and $_POST['submit'] == l10n('Submit') ) 59 { 60 if ( count($collection)>0 ) 61 { 62 $lat = trim($_POST['lat']); 63 $lon = trim($_POST['lon']); 64 $alt = trim($_POST['alt']); 29 $info_message="" ; 30 $error_message=""; 31 32 /************* Mise à jour des meta données ***************/ 33 if ( isset($_POST['update']) && $_POST['update']==l10n('update_exif')) 34 { 35 $exif = @read_exif_data( $exif ); 36 $exif = @array_intersect_key( $exif, array_flip( array('GPSLatitudeRef', 'GPSLatitude', 'GPSLongitudeRef', 'GPSLongitude', 'GPSAltitudeRef', 'GPSAltitude') ) ); 37 38 // error_reporting ( 0 ); 39 // Hide any unknown EXIF tags 40 $GLOBALS['HIDE_UNKNOWN_TAGS'] = FALSE; 41 include $Toolkit_Dir.'Toolkit_Version.php'; // Change: added as of version 1.11 42 // Include the required files for reading and writing Photoshop File Info 43 include $Toolkit_Dir.'JPEG.php'; 44 include $Toolkit_Dir.'XMP.php'; 45 include $Toolkit_Dir.'Photoshop_IRB.php'; 46 include $Toolkit_Dir.'EXIF.php'; 47 include $Toolkit_Dir.'GPS_File_Info.php'; 48 $GLOBALS['HTTP_POST_VARS']=$_POST ; 49 // Copy all of the HTML Posted variables into an array 50 $new_ps_file_info_array = $GLOBALS['HTTP_POST_VARS']; 51 // Some characters are escaped with backslashes in HTML Posted variable 52 // Cycle through each of the HTML Posted variables, and strip out the slashes ' 53 foreach( $new_ps_file_info_array as $var_key => $var_val ){ 54 if ($var_key !="selection") 55 $new_ps_file_info_array[ $var_key ] = stripslashes( $var_val ); 56 57 } 58 $new_ps_file_info_array['selection'] = explode(";",$new_ps_file_info_array['filename']); 59 foreach( $new_ps_file_info_array['selection'] as $filename ) { 60 //====================================================== 61 //= $new_ps_file_info_array[ 'filename' ]; 62 if($filename!="") 63 { // Protect against hackers editing other files 64 65 // copy( $filename, $filename.".bak" ); 66 $path_parts = pathinfo( $filename ); 67 if(1) { 68 if ( strcasecmp( $path_parts["extension"], "jpg" ) != 0 ) 69 { 70 $error_message .= $filename ; 71 $error_message .="Incorrect File Type - JPEG Only\n"; 72 $filename=""; 73 // exit( ); 74 } 75 // Change: removed limitation on file being in current directory - as of version 1.11 76 // Retrieve the header information 77 $jpeg_header_data = get_jpeg_header_data( $filename ); 78 // Retreive the EXIF, XMP and Photoshop IRB information from 79 // the existing file, so that it can be updated 80 $Exif_array = get_EXIF_JPEG( $filename ); 81 $XMP_array = read_XMP_array_from_text( get_XMP_text( $jpeg_header_data ) ); 82 $IRB_array = get_Photoshop_IRB( $jpeg_header_data ); 83 84 // Update the JPEG header information with the new Photoshop File Info 85 $jpeg_header_data = put_GPS_file_info( $jpeg_header_data, $new_ps_file_info_array, $Exif_array, $XMP_array, $IRB_array ); 86 // Check if the Update worked 87 if ( $jpeg_header_data == FALSE ) { 88 // Update of file info didn''t work - output error message 89 $error_message .= "jpeg_header_data 90 Error - Failure update Photoshop File Info : $filename <br>\n"; 91 92 // Output HTML with the form and data which was 93 // sent, to allow the user to fix it 94 95 }else if ( FALSE == put_jpeg_header_data( $filename, $filename, $jpeg_header_data ) ) 96 {// Attempt to write the new JPEG file 97 // Writing of the new file didn''t work - output error message 98 $error_message .= "Error - Failure to write new JPEG : $filename <br>\n"; 99 100 // Output HTML with the form and data which was 101 // sent, to allow the user to fix it 102 103 }else{ 104 $info_message .= l10n('update') . " Exif: " . $filename . " " . l10n('OK') ."<br />" ; 105 106 } 107 $_POST['submit']= l10n('update_database') ; 108 } 109 } 110 } 111 //================================================ 112 $_POST['update'] ="ok"; 113 } 114 115 116 if ( isset($_POST['submit']) ) { 117 $collection = array(); 118 if( !isset ($_POST['target'])) { 119 $_POST['submit'] = l10n('Submit') ; 120 $_POST['target']='selection'; 121 $collection = $_POST['selection']; 122 } 123 124 switch ($_POST['target']) 125 { 126 case 'all' : 127 $collection = $page['cat_elements_id']; 128 break; 129 case 'selection' : 130 if (!isset($_POST['selection']) or count($_POST['selection']) == 0) 131 array_push($page['errors'], l10n('Select at least one picture')); 132 else 133 $collection = $_POST['selection']; 134 break; 135 } 136 137 /******** Mise à jour base de données *****/ 138 if ( $_POST['submit'] == l10n('update_database') ) 139 { 140 if ( count($collection)>0 ) 141 { 142 $lat = trim($_POST['lat']); 143 $lon = trim($_POST['lon']); 144 $alt = trim($_POST['alt']); 65 145 66 if ( strlen($lat)>0 and strlen($lon)>0 ) 67 { 68 if ( (double)$lat<=90 and (double)$lat>=-90 69 and (double)$lon<=180 and (double)$lat>=-180 ) 70 $update_query = 'lat='.$lat.', lon='.$lon; 71 else 72 $page['errors'][] = 'Invalid lat or lon value'; 73 } 74 elseif ( strlen($lat)==0 and strlen($lon)==0 ) 75 $update_query = 'lat=NULL, lon=NULL'; 76 else 77 $page['errors'][] = 'Both lat/lon must be empty or not empty'; 78 79 if ( strlen($alt)==0) 80 $update_query .= ', alt=NULL'; 81 else 82 $update_query .= ', alt=' .$alt ; 83 84 85 86 if (isset($update_query)) 87 { 88 $update_query = ' 89 UPDATE '.IMAGES_TABLE.' SET '.$update_query.' 90 WHERE id IN ('.implode(',',$collection).')'; 91 pwg_query($update_query); 92 cl_meta_invalidate_cache(); 93 } 94 } 95 } 146 if ( strlen($lat)>0 and strlen($lon)>0 ) 147 { 148 if ( (double)$lat<=90 and (double)$lat>=-90 149 and (double)$lon<=180 and (double)$lat>=-180 ) 150 $update_query = 'lat='.$lat.', lon='.$lon; 151 else 152 $page['errors'][] = 'Invalid lat or lon value'; 153 } 154 elseif ( strlen($lat)==0 and strlen($lon)==0 ) 155 $update_query = 'lat=NULL, lon=NULL'; 156 else 157 $page['errors'][] = 'Both lat/lon must be empty or not empty'; 158 159 if ( strlen($alt)==0) 160 $update_query .= ', alt=NULL'; 161 else 162 $update_query .= ', alt=' .$alt ; 163 164 if (isset($update_query)) 165 { 166 $update_query = ' 167 UPDATE '.IMAGES_TABLE.' SET '.$update_query.' 168 WHERE id IN ('.implode(',',$collection).')'; 169 pwg_query($update_query); 170 cl_meta_invalidate_cache(); 171 $info_message .= l10n('update') . " " . IMAGES_TABLE . " : " . l10n('OK') ; 172 $_POST['submit'] = l10n('Submit') ; 173 } 174 175 } 176 } 96 177 } 97 178 … … 180 261 181 262 //========================================================== 182 if (!defined('EDIT_ RV_PATH')) define( 'EDIT_RV_PATH', EDIT_RV_PATH .'admin/' );183 $path = EDIT_ RV_PATH;263 if (!defined('EDIT_CL_PATH')) define( 'EDIT_CL_PATH', EDIT_CL_PATH .'admin/' ); 264 $path = EDIT_CL_PATH; 184 265 $plg_data = implode( '', file($path.'main.inc.php') ); 185 266 if (preg_match("|Version: (.*)|", $plg_data, $val)) 186 { $EDIT_ RV_PATH_plugin['version'] = trim($val[1]); }187 $EDIT_ RV_PATH_plugin = array_map('htmlspecialchars', $EDIT_RV_PATH_plugin);188 $version= $EDIT_ RV_PATH_plugin['version'] ;267 { $EDIT_CL_PATH_plugin['version'] = trim($val[1]); } 268 $EDIT_CL_PATH_plugin = array_map('htmlspecialchars', $EDIT_CL_PATH_plugin); 269 $version= $EDIT_CL_PATH_plugin['version'] ; 189 270 $icon_path = 'themes/default/icon/help.png'; 190 271 $path_js= 'themes/default/js/' ; 191 272 192 273 //================================================================================== 193 $match=""; 274 $match=""; 275 194 276 if ( isset($_POST['submit']) ) 195 277 { 196 197 278 if ($_POST['submit']==l10n('Submit') ) 198 279 { … … 209 290 } 210 291 211 212 292 } 213 293 //================================================================================= 214 294 $src=""; 295 215 296 $template->assign( 216 array( 'EDIT_ RV_PATH' => EDIT_RV_PATH,297 array( 'EDIT_CL_PATH' => EDIT_CL_PATH, 217 298 'path_js' => $path_js, 218 299 'VERSION'=> $version, 219 'EDIT_ RV_PATH_ABS' => dirname(__FILE__).'/',300 'EDIT_CL_PATH_ABS' => dirname(__FILE__).'/', 220 301 ) 221 302 ); 222 303 global $lang_info; 223 if (date_default_timezone_get()) { $adresse = date_default_timezone_get() ;} 224 else{ 225 226 } 227 $adresse = $lang_info['country']; ; 228 $adresse=str_replace("/",", ",$adresse); 229 $template->assign( 'coordinates', 230 array('LAT' => '100', 231 'LON' => '100', 232 'ADRESSE' => $adresse, 233 'ZOOM' => 18, 234 'ALT' => 0 235 ) 236 ); 237 $filename =""; 304 if (date_default_timezone_get()) { 305 $adresse = date_default_timezone_get() ; 306 }else{ 307 308 } 309 $adresse = $lang_info['country']; ; 310 $adresse=str_replace("/",", ",$adresse); 311 $template->assign( 'coordinates', 312 array( 'FILE' => '', 313 'LAT' => '100', 314 'LON' => '100', 315 'ADRESSE' => $adresse, 316 'ZOOM' => 18, 317 'ALT' => 0 318 ) 319 ); 238 320 239 321 if (isset($_POST['submit']) and $_POST['submit']==l10n('selection' )) 240 322 { 241 323 if (isset($collection)) 242 { $lat =1000; 324 { $lat =1000;$first_image=""; 325 243 326 foreach ($collection as $id_0) { 244 327 foreach ($images as $image) { 245 328 if (array_search($id_0,$image)) { 246 329 $_POST['selection'] = $collection ; 247 248 $infos_gps= Get_exif_gps( $image['path'],$image) ; 249 if( $image['lat'] == ''){ 250 $image['lat']=$infos_gps['lat']; 251 $image['lon']=$infos_gps['lon']; 252 $image['alt']=$infos_gps['alt']; 253 }else { 254 $image['lat']=$infos_gps['lat']; 255 $image['lon']=$infos_gps['lon']; 256 $image['alt']=$infos_gps['alt']; 257 } 258 $filename= $image; 259 260 261 if ($lat==1000) { 330 $infos_gps= Get_exif_gps( $image['path'],$image) ; 331 $image['lat']=$infos_gps['lat']; 332 $image['lon']=$infos_gps['lon']; 333 $image['alt']=$infos_gps['alt']; 334 335 if ($lat==1000) { 262 336 $lat= ($image['lat'] <> '') ? $image['lat'] : '100' ; 263 337 $lon= ($image['lon'] <> '') ? $image['lon'] : '3.0' ; … … 266 340 //===================================================== 267 341 $template->assign( 'coordinates', 268 array('LAT' => $lat , 342 array('FILE' => $image['path'], 343 'LAT' => $lat , 269 344 'LON' => $lon , 270 345 'ADRESSE' => $adresse , … … 274 349 ); 275 350 } 351 352 $lon=$image['lon']; 353 $lat=$image['lat']; 354 if($infos_gps['is_exif']) $info_message .='EXIF'; 355 276 356 $lonDMS= dec2dms($lon) ; 277 357 $latDMS= dec2dms($lat) ; 278 if ($infos_gps['lat']=="") 279 $icon='icon/minus.png'; 280 else $icon='icon/minus.png'; 358 281 359 282 360 $tpl_var = array_merge( 283 361 $image, 284 362 array( 285 'icon' => $icon , 363 'filename' => $image['path'], 364 'exif' => $infos_gps['is_exif'] , 286 365 'lat' => $image['lat'] , 287 366 'lon' => $image['lon'] , 288 367 'alt' => $image['alt'] , 289 368 'latDMS' => $latDMS[3] , 290 'lonDMS' => $lonDMS[3] ,369 'lonDMS' => "-->".$lonDMS[3] , 291 370 'adresse' => $adresse , 292 371 'U_TN' => get_thumbnail_url($image), … … 311 390 312 391 313 if ( !empty($filename)) 392 if ( !empty($first_image)) 393 { $error_message .= cl_edit_controler::Memo_Vars($first_image); 394 if (isset($_POST['update'])) 314 395 { 315 396 // document.Envoie.latDMS.value 316 $image= $filename ; 317 $filename= $filename['path'] ; 397 398 399 $image= first_image ; 400 $filename=$image['path'] ; 318 401 $Val_exif=""; 319 402 $Val_XMP=""; 320 // error_reporting ( 0 ); 321 // Hide any unknown EXIF tags 322 /* 323 $GLOBALS['HIDE_UNKNOWN_TAGS'] = FALSE; 324 include $Toolkit_Dir . 'Toolkit_Version.php'; // Change: added as of version 1.11 325 include $Toolkit_Dir . 'JPEG.php'; // Change: Allow this example file to be easily relocatable - as of version 1.11 326 include $Toolkit_Dir . 'JFIF.php'; 327 include $Toolkit_Dir . 'PictureInfo.php'; 328 include $Toolkit_Dir . 'XMP.php'; 329 include $Toolkit_Dir . 'Photoshop_IRB.php'; 330 include $Toolkit_Dir . 'EXIF.php'; 403 331 404 332 $jpeg_header_data = get_jpeg_header_data($filename );333 */405 406 /* */ 334 407 if (!empty($infos_gps)) 335 408 $Position = $infos_gps ; … … 339 412 340 413 414 415 $jpeg_header_data = get_jpeg_header_data($filename ); 341 416 $template->assign( array( 342 417 'filename_abs' => $filename , 343 418 'filename' => $filename, 344 419 'datas' => array( 345 /*'Val_JPEG_APP'=> Generate_JPEG_APP_Segment_HTML( $jpeg_header_data ),420 /* 'Val_JPEG_APP'=> Generate_JPEG_APP_Segment_HTML( $jpeg_header_data ), 346 421 'Val_intrinsic'=> Interpret_intrinsic_values_to_HTML( get_jpeg_intrinsic_values( $jpeg_header_data ) ), 347 422 'Val_Comment'=> Interpret_Comment_to_HTML( $jpeg_header_data ), … … 353 428 'Val_exif'=> Interpret_EXIF_to_HTML( get_EXIF_JPEG( $filename ), $filename), 354 429 'Val_XMP' => Interpret_XMP_to_HTML( read_XMP_array_from_text( get_XMP_text( $jpeg_header_data) ) ), 355 */ 430 */ 356 431 // 357 432 ), 358 433 'Datadase' => ($Position) , 359 434 ) ); 360 } 361 362 function Memo_vars($variables) 363 { 364 ob_start(); 365 echo '<pre>'; 366 print_r($variables); 367 echo '</pre>'; 368 $m= ob_get_contents(); 369 370 ob_end_clean(); 371 return $m; 372 373 } 435 436 437 } 438 } 439 440 374 441 //======================================================================= 375 442 function cl_make_map_picture_url($params) … … 384 451 385 452 386 function Get_exif_gps($filename,$image) 387 { 453 454 function Get_exif_gps($firt_image,$image) 455 { 456 388 457 error_reporting ( 1 ); 458 $filename=$firt_image; 459 389 460 $datas = array(); 390 461 $errors = array(); 391 //392 393 // $Exif_array = get_EXIF_JPEG( $filename );394 // if ( empty($Exif_array) ) return;395 396 $exif = @read_exif_data( $filename );397 462 463 464 $exif = @read_exif_data( $filename ); 465 global $errors;global $template ; 398 466 399 467 if ( empty($exif) ) return; 400 468 $exif = array_intersect_key( $exif, array_flip( array('GPSLatitudeRef', 'GPSLatitude', 'GPSLongitudeRef', 'GPSLongitude', 'GPSAltitudeRef', 'GPSAltitude') ) ); 401 402 403 error_reporting ( 1 ); 404 /* 405 if ( count($exif)<4) 406 return; 407 408 409 if ( !in_array($exif['GPSLatitudeRef'], array('S', 'N') ) ) 410 { 411 $errors[] = $filename. ': GPSLatitudeRef not S or N'; 412 return; 413 } 414 if ( !in_array($exif['GPSLongitudeRef'], array('W', 'E') ) ) 415 { 416 $errors[] = $filename. ': GPSLongitudeRef not W or E'; 417 return; 418 } 419 if (!is_array($exif['GPSLatitude']) or !is_array($exif['GPSLongitude']) ) 420 { 421 $errors[] = $filename. ': GPSLatitude and GPSLongitude are not arrays'; 422 return; 423 } 424 */ 425 426 469 470 //==================================================================== 427 471 $lat = $image['lat'] ; 428 472 $lon = $image['lon'] ; 429 $alt=$image['alt']; 473 $alt = $image['alt']; 474 global $info_message ; 475 476 $is_exif = "'".(is_array($exif['GPSLatitude']) and is_array($exif['GPSLongitude']) )."'" ; 477 if ($is_exif) { 478 $lat_exif = parse_lat_lon( $exif['GPSLatitude'] ); 479 $lon_exif = parse_lat_lon( $exif['GPSLongitude'] ); 480 $alt_exif = Parse_Fract( $exif['GPSAltitude'] ); 481 } 430 482 431 483 if ($lat =="") 432 { 484 { 433 485 $lat = Parse_Lat_Lon( $exif['GPSLatitude'] ); 434 if ( $exif['GPSLatitudeRef']=='S' )$lat = -$lat; 435 $latDMS=$exif['GPSLatitude'][0] . " | " . $exif['GPSLatitude'][1]. " | " . $exif['GPSLatitude'][2] ; 436 486 if ( $exif['GPSLatitudeRef']=='S' ) $lat = -$lat; 487 437 488 }else{ 438 489 $is_exif="false" ; 439 490 if($lat<0) $exif['GPSLatitudeRef']='S' ; 440 491 else $exif['GPSLatitudeRef']='N' ; 441 $latDMS=dec2dms($lat); 442 $exif['GPSLatitude']= $latDMS ; 443 } 444 global $errors; 445 if (!is_array($exif['GPSLatitude']) or !is_array($exif['GPSLongitude']) ) 446 { 447 $errors[] = $filename. ': GPSLatitude and GPSLongitude are not arrays'; 448 //return; 449 } 450 451 if ($lon =="") { 492 493 494 } 495 if ($lon =="") { 452 496 453 $lon = parse_lat_lon( $exif['GPSLongitude'] ); 454 $lonDMS= $exif['GPSLongitude'][0] . " | " . $exif['GPSLongitude'][1] . " | " . $exif['GPSLongitude'][2] ; 455 if ( $exif['GPSLongitudeRef']=='W' ) $lon = -$lon; 497 $lon = parse_lat_lon( $exif['GPSLongitude'] ); 498 if ( $exif['GPSLongitudeRef']=='W' ) $lon = -$lon; 456 499 }else{ 457 500 if ($lon<0) $exif['GPSLongitudeRef'] ='W' ; 458 501 else $exif['GPSLongitudeRef'] ='E' ; 459 $lonDMS=dec2dms($lon); 460 $exif['GPSLongitude']=$lonDMS ; 502 461 503 } 462 504 463 464 505 506 465 507 //======================================================================= 466 508 $altref = 0; … … 474 516 $altref = $exif['GPSAltitudeRef']; 475 517 } 476 //======================================================================== 477 518 //======================================================================== 478 519 $datas[] = array ( 520 'is_exif' => $is_exif, 479 521 ' filename=' => $filename , 480 522 'id' => $image['id'] , … … 500 542 return $datas[0] ; 501 543 } 502 ?> 544 if ($info_message!="") 545 $template->assign('infos',$info_message); 546 if ($error_message!="") 547 $template->assign('errors',$error_message); 548 ?> -
extensions/edit_gmaps/admin/admin_edit.tpl
r9377 r9412 2 2 {* $Id: admin_edit.tpl 2011-01-03 *} 3 3 {if PHPWG_VERSION < 2.2 } {include 4 file=$EDIT_ RV_PATH_ABS|@cat:'header_2_1.tpl'} {else} {include file= $EDIT_RV_PATH_ABS|@cat:'header_2_2.tpl'}4 file=$EDIT_CL_PATH_ABS|@cat:'header_2_1.tpl'} {else} {include file= $EDIT_CL_PATH_ABS|@cat:'header_2_2.tpl'} 5 5 {/if} 6 6 … … 11 11 {if isset($coordinates) && $coordinates.LAT <= 90 } 12 12 var coordinates={ldelim} 13 LAT:'{$coordinates.LAT}', 13 FILE:'$coordinates.filename', 14 LAT:'{$coordinates.LAT}', 14 15 LON:'{$coordinates.LON}', 15 16 ADRESSE:'{$coordinates.ADRESSE}', … … 19 20 {else} 20 21 var coordinates={ldelim} 21 LAT:' ', 22 FILE:'', 23 LAT:' ', 22 24 LON:' ', 23 25 ADRESSE:'{$coordinates.ADRESSE}', … … 52 54 {/html_head} 53 55 54 56 {$file_name} 55 57 56 58 … … 104 106 <a href="{$thumbnail.U_MAP}" target="_blank">{$thumbnail.lat},{$thumbnail.lon}</a> 105 107 {/if} 106 {$thumbnail.file} 108 {$thumbnail.file} 109 107 110 </span> 108 111 … … 134 137 <fieldset> 135 138 <ul class="thumbnails"> 136 {foreach from=$Selectthumbnails item=thumbnail} 139 140 {foreach from=$Selectthumbnails item=thumbnail} 137 141 <li><span class="wrap1"> 138 142 <label> … … 149 153 {/if} 150 154 {$thumbnail.file} 155 151 156 </span> 152 157 </span> 153 </li> 158 </li> 159 154 160 {/foreach} 155 161 </ul> … … 158 164 <label>{'command'|@translate}</label> 159 165 160 161 162 163 164 165 166 167 166 <table> 167 <td> 168 <input class="cluetip" title="{'reset'|@translate}|{'hlp_line4'|@translate}." type="submit" name="submit" value="{'reset'|@translate}" /><br /> 169 </td> 170 <td> 171 <input class="cluetip" title="{'selection'|@translate}|{'hlp_line3'|@translate}." type="submit" name="submit" value="{'selection'|@translate}" /> 172 </td> 173 </table> 168 174 169 175 <label>{'Form'|@translate}</label> 170 176 <table > 171 <td > 172 173 <input class="cluetip" title="{'search_title'|@translate}|{'hlp_line6'|@translate}." type=button value="{'search_title'|@translate}" id="search" /> 174 175 <input class="cluetip" title="{'lieu'|@translate}|{'hlp_line5'|@translate}." type="text" size="70" value="{$match}" name="match" id="match" /> 176 </td> 177 <table > 178 <tr> <input type="text" size="15" value="{$filename}" name="filename" /> 179 <td > 180 <label>Latitude (-90=S to 90=N)</label> 181 <input type="text" size="15" value="{$lat}" name="lat" /> 182 </td> 183 <td> 184 <label>Longitude (-180=E to 180=W) </label> 185 <input type="text" size="15"value="{$lon}" name="lon" /> 186 </td> 187 <td> 188 <label>Altitude </label> 189 <input type="hidden" size="2"value="0" name="altRef" /> 190 <input type="text" size="15"value="{$alt}" name="alt" /> <label> m </label> 191 </td> 192 </tr> 177 <td > 178 179 <input class="cluetip" title="{'search_title'|@translate}|{'hlp_line6'|@translate}." type=button value="{'search_title'|@translate}" id="search" /> 180 181 <input class="cluetip" title="{'lieu'|@translate}|{'hlp_line5'|@translate}." type="text" size="70" value="{$match}" name="match" id="match" /> 182 </td> 193 183 </table> 194 <tr> 195 <table > 196 <tr> 197 <td > 198 <label>Latitude DMS</label><input type="text" size="3" value="{$latRef}" name="latRef" /> 199 <input type="text" size="25" value="{$latDMS}" name="latDMS" /> 200 </td> 201 <td> 202 <label>Longitude DMS </label><input type="text" size="3" value="{$lonRef}" name="lonRef" /> 203 <input type="text" size="25"value="{$lonDMS}" name="lonDMS" /> 204 </td> 205 206 </tr> 207 </table> 208 <tr> 209 210 <td> 211 <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$tag_input_enabled} /></td> 212 </td></tr> 184 <table style="display:none" > 185 186 {assign var="filename" value=""} 187 {foreach from=$Selectthumbnails item=thumbnail} 188 {assign var="filename" value=$filename|@cat:$thumbnail.filename|@cat:";"} 189 {if $thumbnail.lat<>0 } 190 {if $thumbnail.lon<>0} 191 {assign var="lon" value=$thumbnail.lon} 192 {assign var="lat" value=$thumbnail.lat} 193 {assign var="alt" value=$thumbnail.alt} 194 195 {/if} 196 {/if} 197 {/foreach} 198 199 <input type="text" size="89" value="{$filename}" name="filename" /> 200 </table> 201 202 <table> 203 <td > 204 <label class="cluetip" title="{'latitude'|@translate}|{'hlp_latitude'|@translate}." > {'latitude'|@translate} </label> 205 <input type="text" size="15" value="{$lat}" name="lat" /> 206 </td> 207 <td> 208 <label class="cluetip" title="{'longitude'|@translate}|{'hlp_longitude'|@translate}." > {'longitude'|@translate} </label> 209 <input type="text" size="15"value="{$lon}" name="lon" /> 210 </td> 211 <td> 212 <label class="cluetip" title="{'altitude'|@translate}|{'hlp_altitude'|@translate}."> Altitude </label> 213 <input type="hidden" size="2"value="0" name="altRef" /> 214 <input type="text" size="15"value="{$alt}" name="alt" /> <label> m </label> 215 </td> 216 </table> 217 218 <table style=" display:none"> 219 <td > 220 <label>Latitude DMS</label><input type="text" size="3" value="{$latRef}" name="latRef" /> 221 <input type="text" size="25" value="{$latDMS}" name="latDMS" /> 222 </td> 223 <td> 224 <label>Longitude DMS </label><input type="text" size="3" value="{$lonRef}" name="lonRef" /> 225 <input type="text" size="25"value="{$lonDMS}" name="lonDMS" /> 226 </td> 227 <td> 228 <label>Altitude DMS </label><input type="text" size="3" value="{$altRef}" name="altRef" /> 229 <input type="text" size="25"value="{$altDMS}" name="altDMS" /> 230 </td> 231 </table> 232 233 <table> 234 <td> 235 <input class="submit cluetip" title="{'update_database'|@translate}|{'hlp_update_database'|@translate}." type="submit" value="{'update_database'|@translate}" name="submit" {$tag_input_enabled} /></td> 236 </td> 237 <td> 238 <input class="submit cluetip" title="{'update_exif'|@translate}|{'hlp_update_exif'|@translate}." type="submit" value="{'update_exif'|@translate}" name="update" {$tag_input_enabled} /></td> 239 </td> 213 240 </table> 214 241 </fieldset> … … 223 250 </fieldset> 224 251 </fieldset> 252 253 254 255 </fieldset> 256 225 257 </form> 226 258 227 <fieldset style="display:none"> 228 <form name="EditJPEG" id="EditJPEG" action="{$EDIT_RV_PATH}Write_File_Info_Gps.php" method="post"> 229 <input name="filename" size="60" id="filename" name="filename" type="test" value="../../../{$filename}" /> 230 <table> 231 <tr> 232 <td> 233 Latitude Ref 234 </td> 235 <td> 236 <input size="60" id="latRef" name="GPSLatitudeRef" type="text" value="{$latRef}"> 237 </td> 238 239 <td> 240 Latitude 241 </td> 242 <td> 243 <input size="60" id="latDMS" name="GPSLatitude" type="text" value="{$latDMS}"> 244 </td> 245 </tr> 246 <tr> 247 <td> 248 Longitude Ref 249 </td> 250 <td> 251 <input size="60" id="lonRef" name="GPSLongitudeRef" type="text" value="{$lonRef}"> 252 </td> 253 254 <td> 255 Longitude 256 </td> 257 <td> 258 <input size=60 id="lonDMS" name="GPSLongitude" type=\"text\" value="{$lonDMS}"> 259 </td> 260 </tr> 261 <tr> 262 <td> 263 Altitude Ref 264 </td> 265 <td> 266 <input size=60 id="altRef" name="GPSAltitudeRef" type=\"text\" value="{$altRef}"> 267 </td> 268 <td> 269 Altitude 270 </td> 271 <td> 272 <input size=60 id="alt" name="GPSAltitude" type=\"text\" value="{$alt}"> 273 </td> 274 </tr> 275 </table> 276 <br> 277 <input type="submit" value="Update!"> 278 </form> 279 </fieldset> 259 <fieldset > -
extensions/edit_gmaps/admin/admin_edit_meta.php
r9377 r9412 4 4 load_language('lang', dirname(__FILE__).'/../'); 5 5 $admin_url = PHPWG_ROOT_PATH.'admin.php'; 6 7 8 9 6 if ( !isset($_GET['cat']) ) $_GET['cat'] = 'caddie'; 10 7 $_GET['mode'] = 'map'; … … 20 17 21 18 /***********************************************************************************/ 22 if (!defined('TOOL_KIT_PATH')) define( 'TOOL_KIT_PATH', EDIT_ RV_PATH."admin/");19 if (!defined('TOOL_KIT_PATH')) define( 'TOOL_KIT_PATH', EDIT_CL_PATH."admin/"); 23 20 if (!defined('INCLUDE_PATH')) define( 'INCLUDE_PATH', TOOL_KIT_PATH.'include/' ); 24 21 $Toolkit_Dir =INCLUDE_PATH ; 25 22 26 include $Toolkit_Dir . 'fonctions.php';23 include_once $Toolkit_Dir . 'fonctions.php'; 27 24 /***********************************************************************************/ 28 25 … … 55 52 } 56 53 57 // test si mise à jour (valider) 58 if ( isset($_POST['submit']) and $_POST['submit'] == l10n('Submit') ) 59 { 60 if ( count($collection)>0 ) 61 { 54 //**************** mise a jour de la base de données ************************** 55 if ( $_POST['submit'] == l10n('update_database') ) { 56 if ( count($collection)>0 ) { 62 57 $lat = trim($_POST['lat']); 63 58 $lon = trim($_POST['lon']); … … 71 66 else 72 67 $page['errors'][] = 'Invalid lat or lon value'; 73 } 74 elseif ( strlen($lat)==0 and strlen($lon)==0 ) 68 }else if ( strlen($lat)==0 and strlen($lon)==0 ) 75 69 $update_query = 'lat=NULL, lon=NULL'; 76 70 else … … 92 86 cl_meta_invalidate_cache(); 93 87 } 94 } 95 } 96 } 88 } 89 90 }// fin test update 91 92 } // fin post 97 93 98 94 … … 180 176 181 177 //========================================================== 182 if (!defined('EDIT_ RV_PATH')) define( 'EDIT_RV_PATH', EDIT_RV_PATH .'admin/' );183 $path = EDIT_ RV_PATH;178 if (!defined('EDIT_CL_PATH')) define( 'EDIT_CL_PATH', EDIT_CL_PATH .'admin/' ); 179 $path = EDIT_CL_PATH; 184 180 $plg_data = implode( '', file($path.'main.inc.php') ); 185 181 if (preg_match("|Version: (.*)|", $plg_data, $val)) 186 { $EDIT_ RV_PATH_plugin['version'] = trim($val[1]); }187 $EDIT_ RV_PATH_plugin = array_map('htmlspecialchars', $EDIT_RV_PATH_plugin);188 $version= $EDIT_ RV_PATH_plugin['version'] ;182 { $EDIT_CL_PATH_plugin['version'] = trim($val[1]); } 183 $EDIT_CL_PATH_plugin = array_map('htmlspecialchars', $EDIT_CL_PATH_plugin); 184 $version= $EDIT_CL_PATH_plugin['version'] ; 189 185 $icon_path = 'themes/default/icon/help.png'; 190 186 $path_js= 'themes/default/js/' ; … … 194 190 if ( isset($_POST['submit']) ) 195 191 { 192 193 if ($_POST['submit']==l10n('update') ) 194 { 195 $_POST['selection']=array(); 196 $collection =array(); 197 unset($collection); 198 } 196 199 197 200 if ($_POST['submit']==l10n('Submit') ) … … 214 217 $src=""; 215 218 $template->assign( 216 array( 'EDIT_ RV_PATH' => EDIT_RV_PATH,219 array( 'EDIT_CL_PATH' => EDIT_CL_PATH, 217 220 'path_js' => $path_js, 218 221 'VERSION'=> $version, 219 'EDIT_ RV_PATH_ABS' => dirname(__FILE__).'/',222 'EDIT_CL_PATH_ABS' => dirname(__FILE__).'/', 220 223 ) 221 224 ); -
extensions/edit_gmaps/admin/admin_edit_meta.tpl
r9377 r9412 2 2 {* $Id: admin_edit.tpl 2011-01-03 *} 3 3 {if PHPWG_VERSION < 2.2 } {include 4 file=$EDIT_ RV_PATH_ABS|@cat:'header_2_1.tpl'} {else} {include file= $EDIT_RV_PATH_ABS|@cat:'header_2_2.tpl'}4 file=$EDIT_CL_PATH_ABS|@cat:'header_2_1.tpl'} {else} {include file= $EDIT_CL_PATH_ABS|@cat:'header_2_2.tpl'} 5 5 {/if} 6 6 … … 226 226 <fieldset id ="metadata" class="fieldset"> 227 227 <legend>{'Metadata'|@translate}</legend> 228 <h4><a href="{$EDIT_ RV_PATH}Edit_File_gps.php?jpeg_fname={$filename_abs}" >228 <h4><a href="{$EDIT_CL_PATH}Edit_File_gps.php?jpeg_fname={$filename_abs}" > 229 229 Click here to edit the Photoshop File Info for this file</a></h4>{$filename_abs}</fieldset> 230 230 <table> … … 240 240 241 241 <fieldset> 242 <form name="EditJPEG" id="EditJPEG" action="{$EDIT_ RV_PATH}Write_File_Info_Gps.php" method="post">242 <form name="EditJPEG" id="EditJPEG" action="{$EDIT_CL_PATH}Write_File_Info_Gps.php" method="post"> 243 243 <input name="filename" size="60" id="filename" name="filename" type="test" value="../../../{$filename}" /> 244 244 <table> -
extensions/edit_gmaps/admin/header_2_1.tpl
r9377 r9412 1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery. packed.js" now=0}1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.js" now=0} 2 2 {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"} 3 3 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/ui.core.js"} 4 4 {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/ui.resizable.js"} 5 {known_script id="EDIT_RV_script" src=$EDIT_ RV_PATH|@cat:"admin/js/JScript.js"}6 {known_script id="fieldset" src=$EDIT_ RV_PATH|@cat:"admin/js/fieldset.js"}5 {known_script id="EDIT_RV_script" src=$EDIT_CL_PATH|@cat:"admin/js/JScript.js"} 6 {known_script id="fieldset" src=$EDIT_CL_PATH|@cat:"admin/js/fieldset.js"} -
extensions/edit_gmaps/admin/header_2_2.tpl
r9377 r9412 1 1 {combine_script id="jquery" load="header" path = $ROOT_URL|@cat:"themes/default/js/jquery.js"} 2 2 {combine_script id="jquery.cluetip" path = $ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.js" require="jquery" } 3 {combine_script id="jquery.ui" path=$ROOT_URL|@cat:"themes/default/js/ui/ ui.core.js" require="jquery"}4 {combine_script id="jquery.ui.resizable" path=$ROOT_URL|@cat:"themes/default/js/ui/ ui.resizable.js" require="jquery,jquery.ui"}5 {combine_script id="jquery.ui.slider" path=$ROOT_URL|@cat:"themes/default/js/ui/ ui.slider.js" require="jquery,jquery.ui"}6 {combine_script id="jquery.ui.draggable" path=$ROOT_URL|@cat:"themes/default/js/ui/ ui.draggable.js" require="jquery,jquery.ui"}3 {combine_script id="jquery.ui" path=$ROOT_URL|@cat:"themes/default/js/ui/jquery.ui.core.js" require="jquery"} 4 {combine_script id="jquery.ui.resizable" path=$ROOT_URL|@cat:"themes/default/js/ui/jquery.ui.resizable.js" require="jquery,jquery.ui"} 5 {combine_script id="jquery.ui.slider" path=$ROOT_URL|@cat:"themes/default/js/ui/jquery.ui.slider.js" require="jquery,jquery.ui"} 6 {combine_script id="jquery.ui.draggable" path=$ROOT_URL|@cat:"themes/default/js/ui/jquery.ui.draggable.js" require="jquery,jquery.ui"} 7 7 8 8 9 {combine_script id="EDIT_RV_script" path=$EDIT_ RV_PATH|@cat:"admin/js/JScript.js" require="jquery"}10 {combine_script id="fieldset" path=$EDIT_ RV_PATH|@cat:"admin/js/fieldset.js" require="jquery"}9 {combine_script id="EDIT_RV_script" path=$EDIT_CL_PATH|@cat:"admin/js/JScript.js" require="jquery"} 10 {combine_script id="fieldset" path=$EDIT_CL_PATH|@cat:"admin/js/fieldset.js" require="jquery"} -
extensions/edit_gmaps/admin/include/fonctions.php
r9377 r9412 114 114 return $nd[0]/$nd[1]; 115 115 } 116 117 116 118 117 function Parse_Lat_Lon( $arr ) 119 118 { -
extensions/edit_gmaps/admin/js/JScript.js
r9377 r9412 89 89 updateMarkerStatus('Drag ended'); 90 90 getElevation({ 'latLng': marker.getPosition() }); 91 document.Envoie.alt.value = coordinates.ALT;91 92 92 93 93 } … … 103 103 geocodePosition(LatLng); 104 104 getElevation({ 'latLng': marker.getPosition() }); 105 document.Envoie.alt.value = coordinates.ALT;105 106 106 return false; 107 107 … … 120 120 document.Envoie.lon.value = latLng.lng(); 121 121 dms_frac = dec2dms(latLng.lng()); 122 if (d ms_frac.Degre < 0)123 124 else 125 122 if (document.Envoie.lon.value < 0) 123 document.Envoie.lonRef.value = "W"; 124 else 125 document.Envoie.lonRef.value = "E"; 126 126 document.Envoie.lonDMS.value = Math.abs(dms_frac.Degre) +"/1" + " " + dms_frac.Minute +"/1" + " " + dms_frac.Numerator + "/" + dms_frac.Denominator; 127 127 dms_frac = dec2dms(latLng.lat()); 128 if (d ms_frac.Degre < 0)128 if (document.Envoie.lat.value < 0) 129 129 document.Envoie.latRef.value = "S"; 130 130 else 131 131 document.Envoie.latRef.value = "N"; 132 132 document.Envoie.latDMS.value = Math.abs(dms_frac.Degre) + "/1" + " " + dms_frac.Minute + "/1" + " " + dms_frac.Numerator + "/" + dms_frac.Denominator; 133 update_datas();133 // update_datas(); 134 134 } 135 135 … … 197 197 coordinates.ALT = results[0].elevation; 198 198 document.Envoie.alt.value = coordinates.ALT; 199 update_datas(); 200 //styleIcon.set("text", "Elevation: " + results[0].elevation + "m"); 199 altDMS = dec2frac(coordinates.ALT); 200 document.Envoie.altRef.value = "0"; 201 document.Envoie.altDMS.value = altDMS.Numerator + "/" + altDMS.Denominator; 202 //styleIcon.set("text", "Elevation: " + results[0].elevation + "m"); 201 203 } else { 202 // alert("No results found");204 // alert("No results found"); 203 205 } 204 206 } else {
Note: See TracChangeset
for help on using the changeset viewer.