Changeset 10060 for extensions
- Timestamp:
- Apr 5, 2011, 12:45:03 PM (14 years ago)
- Location:
- extensions/edit_gmaps/admin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/edit_gmaps/admin/admin_edit.php
r9412 r10060 5 5 $admin_url = PHPWG_ROOT_PATH.'admin.php'; 6 6 7 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 8 9 /***********************************************************************************/ 10 if (!defined('TOOL_KIT_PATH')) define( 'TOOL_KIT_PATH', EDIT_CL_PATH."admin/"); 11 if (!defined('INCLUDE_PATH')) define( 'INCLUDE_PATH', TOOL_KIT_PATH.'include/' ); 12 $Toolkit_Dir =INCLUDE_PATH ; 13 14 include $Toolkit_Dir . 'fonctions.php'; 15 /***********************************************************************************/ 16 $info_message="" ; 17 $error_message=""; 18 19 /************* Mise à jour des meta données ***************/ 20 if ( isset($_POST['update']) && $_POST['update']==l10n('update_exif')){ 21 $exif = @read_exif_data( $exif ); 22 $exif = @array_intersect_key( $exif, array_flip( array('GPSLatitudeRef', 'GPSLatitude', 'GPSLongitudeRef', 'GPSLongitude', 'GPSAltitudeRef', 'GPSAltitude') ) ); 23 24 // error_reporting ( 0 ); 25 // Hide any unknown EXIF tags 26 $GLOBALS['HIDE_UNKNOWN_TAGS'] = FALSE; 27 include $Toolkit_Dir.'Toolkit_Version.php'; // Change: added as of version 1.11 28 // Include the required files for reading and writing Photoshop File Info 29 include $Toolkit_Dir.'JPEG.php'; 30 include $Toolkit_Dir.'XMP.php'; 31 include $Toolkit_Dir.'Photoshop_IRB.php'; 32 include $Toolkit_Dir.'EXIF.php'; 33 include $Toolkit_Dir.'GPS_File_Info.php'; 34 $GLOBALS['HTTP_POST_VARS']=$_POST ; 35 // Copy all of the HTML Posted variables into an array 36 $new_ps_file_info_array = $GLOBALS['HTTP_POST_VARS']; 37 // Some characters are escaped with backslashes in HTML Posted variable 38 // Cycle through each of the HTML Posted variables, and strip out the slashes ' 39 foreach( $new_ps_file_info_array as $var_key => $var_val ){ 40 if ($var_key !="selection") 41 $new_ps_file_info_array[ $var_key ] = stripslashes( $var_val ); 42 } 43 $new_ps_file_info_array['selection'] = explode(";",$new_ps_file_info_array['filename']); 44 foreach( $new_ps_file_info_array['selection'] as $filename ) { 45 //====================================================== 46 //= $new_ps_file_info_array[ 'filename' ]; 47 if($filename!="") { // Protect against hackers editing other files 48 // copy( $filename, $filename.".bak" ); 49 $path_parts = pathinfo( $filename ); 50 if(1) { 51 if ( strcasecmp( $path_parts["extension"], "jpg" ) != 0 ) { 52 $error_message .= $filename ; 53 $error_message .="Incorrect File Type - JPEG Only\n"; 54 $filename=""; 55 // exit( ); 56 } 57 // Change: removed limitation on file being in current directory - as of version 1.11 58 // Retrieve the header information 59 $jpeg_header_data = get_jpeg_header_data( $filename ); 60 // Retreive the EXIF, XMP and Photoshop IRB information from 61 // the existing file, so that it can be updated 62 $Exif_array = get_EXIF_JPEG( $filename ); 63 $XMP_array = read_XMP_array_from_text( get_XMP_text( $jpeg_header_data ) ); 64 $IRB_array = get_Photoshop_IRB( $jpeg_header_data ); 65 66 // Update the JPEG header information with the new Photoshop File Info 67 $jpeg_header_data = put_GPS_file_info( $jpeg_header_data, $new_ps_file_info_array, $Exif_array, $XMP_array, $IRB_array ); 68 // Check if the Update worked 69 if ( $jpeg_header_data == FALSE ) { 70 // Update of file info didn''t work - output error message 71 $error_message .= "jpeg_header_data 72 Error - Failure update Photoshop File Info : $filename <br>\n"; 73 // Output HTML with the form and data which was 74 // sent, to allow the user to fix it 75 }else if ( FALSE == put_jpeg_header_data( $filename, $filename, $jpeg_header_data ) ) { 76 // Attempt to write the new JPEG file 77 // Writing of the new file didn''t work - output error message 78 $error_message .= "Error - Failure to write new JPEG : $filename <br>\n"; 79 // Output HTML with the form and data which was 80 // sent, to allow the user to fix it 81 }else{ 82 $info_message .= l10n('update') . " Exif: " . $filename . " " . l10n('OK') ."<br />" ; 83 } 84 $_POST['submit']= l10n('update_database') ; 85 } 86 } 87 } 88 $_POST['update'] ="ok"; 89 } 90 /****************************************************************/ 7 91 if ( !isset($_GET['cat']) ) $_GET['cat'] = 'caddie'; 8 92 $_GET['mode'] = 'map'; 9 if (PHPWG_VERSION < 2.2 ) 10 include (PHPWG_ROOT_PATH.'admin/element_set.php'); 11 else 12 include (dirname(__FILE__).'\element_set.php'); 13 14 15 16 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 17 18 19 /***********************************************************************************/ 20 if (!defined('TOOL_KIT_PATH')) define( 'TOOL_KIT_PATH', EDIT_CL_PATH."admin/"); 21 if (!defined('INCLUDE_PATH')) define( 'INCLUDE_PATH', TOOL_KIT_PATH.'include/' ); 22 $Toolkit_Dir =INCLUDE_PATH ; 23 24 include $Toolkit_Dir . 'fonctions.php'; 25 /***********************************************************************************/ 26 27 28 $template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d image', '%d images', count($page['cat_elements_id'])).' - '.$page['title']); 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(); 93 if (PHPWG_VERSION < 2.2 ) { 94 include (PHPWG_ROOT_PATH.'admin/element_set.php'); 95 } else { 96 if (!isset($page['title'])) $page['title']=""; 97 include (PHPWG_ROOT_PATH.'admin/batch_manager.php'); 98 $template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d image', '%d images', count($page['cat_elements_id'])).' - '.$page['title']); 99 } 100 101 if ( isset($_POST['submit']) ) { 102 $collection = array(); 118 103 if( !isset ($_POST['target'])) { 119 104 $_POST['submit'] = l10n('Submit') ; … … 122 107 } 123 108 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']); 145 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) 109 switch ($_POST['target']) 110 { 111 case 'all' : 112 $collection = $page['cat_elements_id']; 113 break; 114 case 'selection' : 115 if (!isset($_POST['selection']) or count($_POST['selection']) == 0) 116 array_push($page['errors'], l10n('Select at least one photo')); 117 else 118 $collection = $_POST['selection']; 119 break; 120 } 121 122 /******** Mise à jour base de données *****/ 123 if ( $_POST['submit'] == l10n('update_database') ){ 124 if ( count($collection)>0 ){ 125 $lat = trim($_POST['lat']); 126 $lon = trim($_POST['lon']); 127 $alt = trim($_POST['alt']); 128 129 if ( strlen($lat)>0 and strlen($lon)>0 ) { 130 if ( (double)$lat<=90 and (double)$lat>=-90 131 and (double)$lon<=180 and (double)$lat>=-180 ) 132 $update_query = 'lat='.$lat.', lon='.$lon; 133 else 134 $page['errors'][] = 'Invalid lat or lon value'; 135 } 136 elseif ( strlen($lat)==0 and strlen($lon)==0 ) 137 $update_query = 'lat=NULL, lon=NULL'; 138 else 139 $page['errors'][] = 'Both lat/lon must be empty or not empty'; 140 141 if ( strlen($alt)==0) 160 142 $update_query .= ', alt=NULL'; 161 143 else 162 144 $update_query .= ', alt=' .$alt ; 163 145 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 } 177 } 178 179 180 $template->append( 181 'specials', 182 array( 183 $admin_url.get_query_string_diff(array('start','cat')).'&cat=caddie' => l10n('Caddie') 184 ), 185 true 186 ); 187 146 if (isset($update_query)){ 147 $update_query = ' 148 UPDATE '.IMAGES_TABLE.' SET '.$update_query.' 149 WHERE id IN ('.implode(',',$collection).')'; 150 pwg_query($update_query); 151 cl_meta_invalidate_cache(); 152 $info_message .= l10n('update') . " " . IMAGES_TABLE . " : " . l10n('OK') ; 153 $_POST['submit'] = l10n('Submit') ; 154 } 155 } 156 } 157 } 158 /**************************************/ 159 $specials_selected = null; 160 foreach( array('caddie'=>'Caddie', 'recent'=>'Recent photos') as $k => $v) 161 { 162 $link = $admin_url.get_query_string_diff(array('start','cat')).'&cat='.$k; 163 $template->append( 164 'specials', 165 array( 166 $link => l10n($v), 167 ), 168 true 169 ); 170 if ($k == $_GET['cat']) $specials_selected = $link; 171 } 172 $template->assign('specials_selected', $specials_selected); 173 /****************************************/ 188 174 $query = ' 189 175 SELECT id,name,uppercats,global_rank … … 321 307 if (isset($_POST['submit']) and $_POST['submit']==l10n('selection' )) 322 308 { 323 if (isset($collection)) 324 { $lat =1000;$first_image=""; 325 326 foreach ($collection as $id_0) { 327 foreach ($images as $image) { 328 if (array_search($id_0,$image)) { 329 $_POST['selection'] = $collection ; 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) { 336 $lat= ($image['lat'] <> '') ? $image['lat'] : '100' ; 337 $lon= ($image['lon'] <> '') ? $image['lon'] : '3.0' ; 338 $alt= ($image['alt'] <> '') ? $image['alt'] : '0' ; 339 if($lat != '100') $lat=$image['lat']; 340 //===================================================== 341 $template->assign( 'coordinates', 342 array('FILE' => $image['path'], 343 'LAT' => $lat , 309 if (isset($collection)) { 310 $lat =1000;$first_image=""; 311 foreach ($collection as $id_0) { 312 foreach ($images as $image) { 313 if (array_search($id_0,$image)) { 314 $_POST['selection'] = $collection ; 315 $infos_gps= Get_exif_gps( $image['path'],$image) ; 316 $image['lat']=$infos_gps['lat']; 317 $image['lon']=$infos_gps['lon']; 318 $image['alt']=$infos_gps['alt']; 319 if ($lat==1000) { 320 $lat= ($image['lat'] <> '') ? $image['lat'] : '100' ; 321 $lon= ($image['lon'] <> '') ? $image['lon'] : '3.0' ; 322 $alt= ($image['alt'] <> '') ? $image['alt'] : '0' ; 323 if($lat != '100') $lat=$image['lat']; 324 //===================================================== 325 $template->assign( 'coordinates', 326 array('FILE' => $image['path'], 327 'LAT' => $lat , 344 328 'LON' => $lon , 345 329 'ADRESSE' => $adresse , 346 330 'ZOOM' => 4, 347 331 'ALT' => $alt , 348 332 ) 349 333 ); … … 361 345 $image, 362 346 array( 363 364 365 366 367 368 369 370 371 372 373 'U_MAP' => cl_make_map_picture_url(347 'filename' => $image['path'], 348 'exif' => $infos_gps['is_exif'] , 349 'lat' => $image['lat'] , 350 'lon' => $image['lon'] , 351 'alt' => $image['alt'] , 352 'latDMS' => $latDMS[3] , 353 'lonDMS' => "-->".$lonDMS[3] , 354 'adresse' => $adresse , 355 'U_TN' => get_thumbnail_url($image), 356 'TITLE' => get_thumbnail_title($image), 357 'U_MAP' => cl_make_map_picture_url( 374 358 array( 375 359 'image_id'=>$image['id'], 376 360 'image_file'=>$image['file'], 377 361 ) 378 379 362 ), 380 ) 381 ); 382 363 ) 364 ); 383 365 $template->append('Selectthumbnails', $tpl_var); 384 366 } … … 392 374 if ( !empty($first_image)) 393 375 { $error_message .= cl_edit_controler::Memo_Vars($first_image); 394 if (isset($_POST['update'])) 395 { 376 if (isset($_POST['update'])) { 396 377 // document.Envoie.latDMS.value 397 398 399 378 $image= first_image ; 400 379 $filename=$image['path'] ; 401 380 $Val_exif=""; 402 $Val_XMP=""; 403 404 405 381 $Val_XMP=""; 406 382 /* */ 407 383 if (!empty($infos_gps)) 408 384 $Position = $infos_gps ; 409 410 385 else $Position = Get_exif_gps($filename,$image) ; 411 412 413 414 386 415 387 $jpeg_header_data = get_jpeg_header_data($filename ); -
extensions/edit_gmaps/admin/admin_edit.tpl
r9412 r10060 1 1 {html_head} 2 2 {* $Id: admin_edit.tpl 2011-01-03 *} 3 {if PHPWG_VERSION < 2.2 } {include 4 file=$EDIT_CL_PATH_ABS|@cat:'header_2_1.tpl'} {else} {include file= $EDIT_CL_PATH_ABS|@cat:'header_2_2.tpl'} 3 {if PHPWG_VERSION < 2.2 } 4 {include file=$EDIT_CL_PATH_ABS|@cat:'header_2_1.tpl'} 5 {else} 6 {include file= $EDIT_CL_PATH_ABS|@cat:'header_2_2.tpl'} 5 7 {/if} 6 8 … … 81 83 | <a href="{$U_DISPLAY}&display=all">{'all'|@translate}</a> 82 84 </p> 83 </fieldset> 84 {if empty($Selectthumbnails) }{/if} 85 85 </fieldset> 86 86 87 87 <form action="" method="post" id="Envoie" name="Envoie" > … … 89 89 90 90 <fieldset id="Elements" class="fieldset"> 91 <legend>{'Elements'|@translate}</legend> 92 93 {if !empty($navbar) }{include file='navigation_bar.tpl'} {/if} 91 <legend>{'Elements'|@translate} 92 {if !empty($navbar) }{include file='navigation_bar.tpl'} {/if}</legend> 94 93 <fieldset > 95 94 <ul class="thumbnails"> … … 121 120 <td><label><input type="radio" name="target" value="all" /> {'all'|@translate}</label></td> 122 121 <td><label><input type="radio" name="target" value="selection" checked="checked" /> {'selection'|@translate}</label></td> 123 < td><input class="cluetip submit " title="{'selection'|@translate}|{'hlp_line3'|@translate}." type="submit" name="submit" value="{'selection'|@translate}" {$tag_input_enabled} /></td>124 125 </fieldset>122 <input class="cluetip submit" title="{'selection'|@translate}|{'hlp_line3'|@translate}." type="submit" name="submit" value="{'selection'|@translate}" /> 123 </table> 124 </fieldset> 126 125 </fieldset> 127 126 <script> 128 {if empty($Selectthumbnails) } 129 130 var no_affiche=true ; 131 {else} 132 var no_affiche=false ; 133 {/if} </script> 134 <fieldset id ="geoposition" class="fieldset"> 127 128 {if empty($Selectthumbnails) } 129 var no_affiche="false" ; 130 {else} 131 var no_affiche="true" ; 132 {/if} 133 </script> 134 135 <fieldset id ="geoposition" class="fieldset" > 135 136 <legend>{'Selection'|@translate}</legend> 136 137 … … 166 167 <table> 167 168 <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}" /> 169 <input class="cluetip submit" title="{'reset'|@translate}|{'hlp_line4'|@translate}." 170 type="submit" name="submit" value="{'reset'|@translate}" /><br /> 171 </td> 172 <td> 173 <input class="cluetip submit" title="{'selection'|@translate}|{'hlp_line3'|@translate}." 174 type="submit" name="submit" value="{'selection'|@translate}" /> 172 175 </td> 173 176 </table> … … 233 236 <table> 234 237 <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>238 <input class="cluetip submit" title="{'update_database'|@translate}|{'hlp_update_database'|@translate}." type="submit" value="{'update_database'|@translate}" name="submit" {$tag_input_enabled} /></td> 239 </td> 240 <td> 241 <input class="cluetip submit" title="{'update_exif'|@translate}|{'hlp_update_exif'|@translate}." type="submit" value="{'update_exif'|@translate}" name="update" {$tag_input_enabled} /></td> 239 242 </td> 240 243 </table> -
extensions/edit_gmaps/admin/header_2_2.tpl
r9665 r10060 1 1 {combine_script id="jquery" load="header" path = $ROOT_URL|@cat:"themes/default/js/jquery.min.js "} 2 {combine_script id="jquery.cluetip" path = $ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.js" require="jquery" } 3 4 {combine_script id="EDIT_RV_script" path=$EDIT_CL_PATH|@cat:"admin/js/JScript.js" require="jquery"} 5 {combine_script id="fieldset" path=$EDIT_CL_PATH|@cat:"admin/js/fieldset.js" require="jquery"} 2 {combine_script id="jquery.cluetip" path = $ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.js" require="jquery" } 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/include/EXIF.php
r9412 r10060 118 118 function get_EXIF_JPEG( $filename ) 119 119 { 120 global $error_message ; 120 121 // Change: Added as of version 1.11 121 122 // Check if a wrapper is being used - these are not currently supported (see notes at top of file) … … 123 124 { 124 125 // A HTTP or FTP wrapper is being used - show a warning and abort 125 echo"HTTP and FTP wrappers are currently not supported with EXIF - See EXIF functionality documentation - a local file must be specified<br>";126 echo"To work on an internet file, copy it locally to start with:<br><br>\n";127 echo"\$newfilename = tempnam ( \$dir, \"tmpexif\" );<br>\n";128 echo"copy ( \"http://whatever.com\", \$newfilename );<br><br>\n";126 $error_message .= "HTTP and FTP wrappers are currently not supported with EXIF - See EXIF functionality documentation - a local file must be specified<br>"; 127 $error_message .= "To work on an internet file, copy it locally to start with:<br><br>\n"; 128 $error_message .= "\$newfilename = tempnam ( \$dir, \"tmpexif\" );<br>\n"; 129 $error_message .= "copy ( \"http://whatever.com\", \$newfilename );<br><br>\n"; 129 130 return FALSE; 130 131 } … … 167 168 { 168 169 // Could't open the file - exit 169 echo"<p>Could not open file $filename</p>\n";170 $error_message .= "<p>Could not open file $filename</p>\n"; 170 171 return FALSE; 171 172 } … … 296 297 function get_Meta_JPEG( $filename ) 297 298 { 299 global $error_message ; 298 300 // Change: Added as of version 1.11 299 301 // Check if a wrapper is being used - these are not currently supported (see notes at top of file) … … 301 303 { 302 304 // A HTTP or FTP wrapper is being used - show a warning and abort 303 echo"HTTP and FTP wrappers are currently not supported with Meta - See EXIF/Meta functionality documentation - a local file must be specified<br>";304 echo"To work on an internet file, copy it locally to start with:<br><br>\n";305 echo"\$newfilename = tempnam ( \$dir, \"tmpmeta\" );<br>\n";306 echo"copy ( \"http://whatever.com\", \$newfilename );<br><br>\n";305 $error_message .= "HTTP and FTP wrappers are currently not supported with Meta - See EXIF/Meta functionality documentation - a local file must be specified<br>"; 306 $error_message .= "To work on an internet file, copy it locally to start with:<br><br>\n"; 307 $error_message .= "\$newfilename = tempnam ( \$dir, \"tmpmeta\" );<br>\n"; 308 $error_message .= "copy ( \"http://whatever.com\", \$newfilename );<br><br>\n"; 307 309 return FALSE; 308 310 } … … 345 347 { 346 348 // Could't open the file - exit 347 echo"<p>Could not open file $filename</p>\n";349 $error_message .= "<p>Could not open file $filename</p>\n"; 348 350 return FALSE; 349 351 } … … 472 474 function get_EXIF_TIFF( $filename ) 473 475 { 476 global $error_message ; 474 477 // Change: Added as of version 1.11 475 478 // Check if a wrapper is being used - these are not currently supported (see notes at top of file) … … 477 480 { 478 481 // A HTTP or FTP wrapper is being used - show a warning and abort 479 echo"HTTP and FTP wrappers are currently not supported with TIFF - See EXIF/TIFF functionality documentation - a local file must be specified<br>";480 echo"To work on an internet file, copy it locally to start with:<br><br>\n";481 echo"\$newfilename = tempnam ( \$dir, \"tmptiff\" );<br>\n";482 echo"copy ( \"http://whatever.com\", \$newfilename );<br><br>\n";482 $error_message .= "HTTP and FTP wrappers are currently not supported with TIFF - See EXIF/TIFF functionality documentation - a local file must be specified<br>"; 483 $error_message .= "To work on an internet file, copy it locally to start with:<br><br>\n"; 484 $error_message .= "\$newfilename = tempnam ( \$dir, \"tmptiff\" );<br>\n"; 485 $error_message .= "copy ( \"http://whatever.com\", \$newfilename );<br><br>\n"; 483 486 return FALSE; 484 487 } … … 491 494 { 492 495 // Could't open the file - exit 493 echo"<p>Could not open file $filename</p>\n";496 $error_message .= "<p>Could not open file $filename</p>\n"; 494 497 return FALSE; 495 498 } … … 1128 1131 function read_Multiple_IFDs( $filehnd, $Tiff_offset, $Byte_Align, $Tag_Definitions_Name, $local_offsets = FALSE, $read_next_ptr = TRUE ) 1129 1132 { 1133 global $error_message ; 1130 1134 // Start at the offset of the first IFD 1131 1135 $Next_Offset = 0; … … 1140 1144 { 1141 1145 // Error seeking to position of next IFD 1142 echo"<p>Error: Corrupted EXIF</p>\n";1146 $error_message .= "<p>Error: Corrupted EXIF</p>\n"; 1143 1147 return FALSE; 1144 1148 } … … 1189 1193 function read_IFD_universal( $filehnd, $Tiff_offset, $Byte_Align, $Tag_Definitions_Name, $local_offsets = FALSE, $read_next_ptr = TRUE ) 1190 1194 { 1195 global $error_message ; 1196 1191 1197 if ( ( $filehnd == NULL ) || ( feof( $filehnd ) ) ) 1192 1198 { … … 1210 1216 { 1211 1217 // Huge number of entries - abort 1212 echo "<p>Error: huge number of EXIF entries - EXIF is probably Corrupted</p>\n";1218 $error_message .= "<p>".$No_Entries."Error: huge number of EXIF entries - EXIF is probably Corrupted</p>\n"; 1213 1219 1214 1220 return array ( FALSE , 0); … … 1235 1241 { 1236 1242 // Couldn't read the IFD Data properly, Some Casio files have no Next IFD pointer, hence cause this error 1237 echo"<p>Error: EXIF Corrupted</p>\n";1243 $error_message .= "<p>Error: EXIF Corrupted</p>\n"; 1238 1244 return array(FALSE, 0); 1239 1245 } … … 1291 1297 if ( $Data_Count > 100000 ) 1292 1298 { 1293 // echo"<p>Error: huge EXIF data count - EXIF is probably Corrupted</p>\n";1299 // $error_message .= "<p>Error: huge EXIF data count - EXIF is probably Corrupted</p>\n"; 1294 1300 1295 1301 // Some Casio files have no Next IFD pointer, hence cause errors … … 2202 2208 ******************************************************************************/ 2203 2209 2204 function get_IFD_Data_Type( $input_data, $data_type, $Byte_Align ) 2205 { 2210 function get_IFD_Data_Type( $input_data, $data_type, $Byte_Align ){ 2211 global $error_message ; 2206 2212 // Check if this is a Unsigned Byte, Unsigned Short or Unsigned Long 2207 2213 if (( $data_type == 1 ) || ( $data_type == 3 ) || ( $data_type == 4 )) … … 2228 2234 // to return multiple values instead of a single value 2229 2235 2230 echo"<p>Error - ASCII Strings should not be processed in get_IFD_Data_Type</p>\n";2236 $error_message .= "<p>Error - ASCII Strings should not be processed in get_IFD_Data_Type</p>\n"; 2231 2237 return "Error Should never get here"; //explode( "\x00", $input_data ); 2232 2238 } -
extensions/edit_gmaps/admin/js/JScript.js
r9412 r10060 279 279 jQuery(document).ready(function () { 280 280 281 282 281 jQuery('.cluetip').cluetip({ 283 282 width: 300, height: 100, 284 splitTitle: '|' 283 splitTitle: '|', 284 clickThrough: true 285 285 } 286 286 ); -
extensions/edit_gmaps/admin/js/fieldset.js
r8501 r10060 1 if (typeof ef_animate_fast == "undefined") 2 var ef_animate_fast =true;1 if (typeof ef_animate_fast == "undefined") 2 var ef_animate_fast = true; 3 3 4 // Smart Fieldsets initialization/ 5 if (typeof ef_plus_bullet_path == "undefined") 6 { 7 var ef_plus_bullet_path = './plugins/edit_gmaps/admin/icon/plus.png'; 8 var ef_minus_bullet_path = './plugins/edit_gmaps/admin/icon/minus.png'; 9 10 } 4 // Smart Fieldsets initialization/ 5 if (typeof ef_plus_bullet_path == "undefined") { 6 var ef_plus_bullet_path = './plugins/edit_gmaps/admin/icon/plus.png'; 7 var ef_minus_bullet_path = './plugins/edit_gmaps/admin/icon/minus.png'; 11 8 12 if (typeof ef_separator == "undefined") 13 var ef_separator = ' : '; 9 } 14 10 15 function ef_reduce(fieldset_id, fast) { 16 var l_m = jQuery('#' + fieldset_id + ' legend'); 17 if (ef_reduce.arguments.length < 2) fast = ef_animate_fast; 18 if (!l_m.is('.ef_command')) l_m.addClass('ef_command'); 19 if (!jQuery('#' + fieldset_id).is(':hidden')) 20 l_m.trigger('ef_reduce_private', fast); 21 l_m.removeClass('ef_command'); 11 if (typeof ef_separator == "undefined") 12 var ef_separator = ' : '; 22 13 23 } 14 function ef_reduce(fieldset_id, fast) { 15 l_m = jQuery('#' + fieldset_id + ' legend'); 16 if (ef_reduce.arguments.length < 2) fast = ef_animate_fast; 17 if (!l_m.is('.ef_command')) l_m.addClass('ef_command'); 18 if (!jQuery('#' + fieldset_id).is(':hidden')) 19 l_m.trigger('ef_reduce_private', fast.fast,this); 20 l_m.removeClass('ef_command'); 24 21 25 function ef_maximize(fieldset_id, fast) { 26 var l_r = jQuery('#' + fieldset_id + '_reduced_legend'); 27 if (ef_maximize.arguments.length < 2) fast = ef_animate_fast; 28 if (!l_r.is('.ef_command')) l_r.addClass('ef_command'); 29 if (jQuery('#' + fieldset_id).is(':hidden')) 30 l_r.trigger('ef_maximize_private', fast); 31 l_r.removeClass('ef_command'); 32 } 22 } 33 23 34 35 function ef_init(fieldset_id, cache_id) { 36 jQuery(document).ready(function () { 37 var f_m = jQuery('#' + fieldset_id); 38 var l_m = jQuery('#' + fieldset_id + ' legend'); 39 var l_txt = l_m.text(); 40 var f_r = f_m; 41 var l_r = l_m; 24 function ef_maximize(fieldset_id, fast) { 25 l_r = jQuery('#' + fieldset_id + '_reduced_legend'); 26 if (ef_maximize.arguments.length < 2) fast = ef_animate_fast; 27 if (!l_r.is('.ef_command')) l_r.addClass('ef_command'); 28 if (jQuery('#' + fieldset_id).is(':hidden')) 29 l_r.trigger('ef_maximize_private', fast); 30 l_r.removeClass('ef_command'); 31 32 } 42 33 43 if (ef_minus_bullet_path != '') l_m.prepend( 34 var l_m, l_r; 35 function ef_init(fieldset_id, cache_id) { 36 jQuery(document).ready(function () { 37 var f_m = jQuery('#' + fieldset_id); 38 l_m = jQuery('#' + fieldset_id + ' legend'); 39 var l_txt = l_m.text(); 40 var f_r = f_m; 41 l_r = l_m; 42 43 if (ef_minus_bullet_path != '') l_m.prepend( 44 44 '<img alt = "" title = ""' + 45 45 'src = "' + ef_minus_bullet_path + '"' + '> ' 46 46 ); 47 l_m.addClass('ef_legends'); 48 l_m.addClass('ef_click_ok'); 49 47 l_m.addClass('ef_legends'); 48 l_m.addClass('ef_click_ok'); 50 49 51 f_r = jQuery('#' + fieldset_id + " ").clone();52 l_r = jQuery('#' + fieldset_id + " LEGEND").clone();53 f_r.empty();54 l_r.appendTo(f_r);55 56 f_r.attr('id', fieldset_id + '_reduced');57 f_r.insertAfter(f_m);58 f_r.css({display: 'none' });59 60 61 l_r.attr('id', fieldset_id + '_reduced_legend');62 l_r.addClass('ef_legends');63 l_r.addClass('ef_click_ok');64 50 65 51 f_r = jQuery('#' + fieldset_id + " ").clone(); 52 l_r = jQuery('#' + fieldset_id + " LEGEND").clone(); 53 f_r.empty(); 54 l_r.appendTo(f_r); 66 55 67 l_r.css({ 68 outlineColor: "invert", 69 opacity: 0 70 }); 71 72 if (ef_plus_bullet_path == '') 73 l_r.append( 56 f_r.attr('id', fieldset_id + '_reduced'); 57 f_r.insertAfter(f_m); 58 f_r.css({ display: 'none' }); 59 60 61 l_r.attr('id', fieldset_id + '_reduced_legend'); 62 l_r.addClass('ef_legends'); 63 l_r.addClass('ef_click_ok'); 64 65 66 67 l_r.css({ 68 outlineColor: "invert", 69 opacity: 0 70 }); 71 72 if (ef_plus_bullet_path == '') 73 l_r.append( 74 74 '<span style = "padding-left:' + l_m.css('padding-left') + ';">' + 75 75 l_txt + '</' + 'span>' + ef_separator 76 76 ); 77 else 78 { 77 else { 79 78 80 lg= jQuery(l_r).find("img");81 if(lg.length>0)82 lg.get(0).src = ef_plus_bullet_path;79 lg = jQuery(l_r).find("img"); 80 if (lg.length > 0) 81 lg.get(0).src = ef_plus_bullet_path; 83 82 84 l_r.append(' ' + ef_separator);85 83 l_r.append(' ' + ef_separator); 84 } 86 85 87 f_r.append('<span id="' + cache_id +'" > </span>');88 89 l_m.bind('ef_reduce_private', function (event, fast) { // Reduce 90 91 if (l_m.is('.ef_command, .ef_click_ok')) { 92 if (fast) {93 f_m.hide();94 f_r.show();95 f_r.find('*').css({opacity: 1});96 }97 else {98 f_m.find('*').not('.ef_legends, img').animate(99 {opacity: 0} ,100 200,86 f_r.append('<span id="' + cache_id + '" > </span>'); 87 jQuery('.ef_legends').css('cursor', 'pointer'); 88 89 l_m.bind('ef_reduce_private', function (event, fast) { // Reduce 90 91 if (l_m.is('.ef_command, .ef_click_ok')) { 92 if (fast) { 93 f_m.hide(); 94 f_r.show(); 95 f_r.find('*').css({ opacity: 1 }); 96 } 97 else { 98 f_m.find('*').not('.ef_legends, img').animate( 99 { opacity: 0 }, 200, 101 100 function () { 102 103 104 f_r.find('*').css({opacity: 1});105 101 f_m.slideUp(400); 102 f_r.slideDown(400, function () { 103 f_r.find('*').css({ opacity: 1 }); 104 }); 106 105 } 107 106 ); 108 } 109 } 110 }); 111 l_r.bind('ef_maximize_private', function (event, fast) { // Maximize 112 if (l_r.is('.ef_command, .ef_click_ok')) { 113 if (fast) { 114 f_r.hide(); 115 f_m.show(); 116 } else { 117 f_r.find('*').css({opacity: 0}); 118 f_r.slideUp(400); 119 f_m.slideDown(400, function () { 120 f_m.find('*').not('.ef_legends, img').animate( 121 {opacity: 1}, 122 200 123 ); 124 }); 125 } 126 } 127 }); 128 l_m.click(function () { // Reduce 129 l_m.trigger('ef_reduce_private', ef_animate_fast); 130 }); 131 l_r.click(function () { // Maximize 132 l_r.trigger('ef_maximize_private', ef_animate_fast); 133 }); 107 } 108 } 109 }); 110 111 l_r.bind('ef_maximize_private', function (event, fast) { // Maximize 112 if (l_r.is('.ef_command, .ef_click_ok')) { 113 if (fast) { 114 f_r.hide(); 115 f_m.show(); 116 } else { 117 f_r.find('*').css({ opacity: 0 }); 118 f_r.slideUp(400); 119 f_m.slideDown(400, function () { 120 f_m.find('*').not('.ef_legends, img').animate({ opacity: 1 },200 ); 134 121 }); 122 } 135 123 } 124 }); 125 126 l_m.click(function () { // Reduce 127 l_m.trigger('ef_reduce_private', ef_animate_fast); 128 }); 129 130 l_r.click(function () { // Maximize 131 l_r.trigger('ef_maximize_private', ef_animate_fast); 132 }); 133 if (no_affiche!="true") { 134 ef_reduce("geoposition", { fast: true }) 135 // jQuery("#Envoie").trigger("submit"); 136 } else { 137 ef_reduce("Elements", { fast: true }) 138 } 139 }); 140 } 136 141 137 142 138 139 140 143 jQuery(document).ready(function () { 144 if (jQuery(".fieldset").length >= 1) 145 jQuery(".fieldset").each( 141 146 function (i) { 142 143 144 145 146 147 148 147 id0 = jQuery(this).attr("id"); 148 if (id0 == "") jQuery(this).attr("id", "Cadre_" + i); 149 id0 = jQuery(this).attr("id"); 150 // Update of the '#cache' value when changing the selected value in the fieldset 151 jQuery("#" + id0 + ' .inputs').click(function () { 152 jQuery("#" + id0).text(jQuery("#" + id0 + ' .inputs:checked').next().text()); 153 }); 149 154 }); 150 151 152 153 154 155 // Some changes of the defaults, nothing to see with Smart Fieldsets 156 // jQuery('input').attr('checked', 'true'); 157 jQuery('code').css('font-size', 'larger'); 158 jQuery('#ef_presentation label, #ef_presentation input').css('cursor', 'pointer'); 159 }); 155 160 156 161 157 162 158 159 160 163 jQuery(document).ready(function () { 164 if (jQuery(".fieldset").length >= 1) { 165 jQuery(".fieldset").each( 161 166 function (i) { 162 163 167 id0 = jQuery(this).attr("id"); 168 ef_init(id0, 'cache' + i); 164 169 165 170 }) 166 }167 if (no_affiche) {168 ef_reduce("geoposition", true)169 } else {170 ef_reduce("Elements", true)171 }172 171 173 }) 172 } 173 174 }) 174 175 175 176
Note: See TracChangeset
for help on using the changeset viewer.