Changeset 5226
- Timestamp:
- Mar 21, 2010, 7:20:07 PM (15 years ago)
- Location:
- extensions/AMetaData
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/admin/amd_metadata_select.tpl
r5088 r5226 156 156 { 157 157 $("#iHLTOrderTag").html("↑"); 158 $("#iHLTOrderLabel").html(""); 158 159 $("#iHLTOrderNum").html(""); 159 160 } 161 else if($("#iSelectOrderTagList").val()=="num") 162 { 163 $("#iHLTOrderTag").html(""); 164 $("#iHLTOrderLabel").html(""); 165 $("#iHLTOrderNum").html("↑"); 166 } 160 167 else 161 168 { 169 // by label 162 170 $("#iHLTOrderTag").html(""); 163 $("#iHLTOrderNum").html("↑"); 171 $("#iHLTOrderLabel").html("↑"); 172 $("#iHLTOrderNum").html(""); 164 173 } 165 174 } … … 194 203 <option value="magic" {if $datas.config_GetListTags_FilterType=="magic"}selected{/if}>{'g003_magic_filter'|@translate}</option> 195 204 <option value="exif" {if $datas.config_GetListTags_FilterType=="exif"}selected{/if}>Exif</option> 205 <option value="exif.Canon" {if $datas.config_GetListTags_FilterType=="exif.Canon"}selected{/if}>Exif [Canon]</option> 206 <option value="exif.Nikon" {if $datas.config_GetListTags_FilterType=="exif.Nikon"}selected{/if}>Exif [Nikon]</option> 207 <option value="exif.Pentax" {if $datas.config_GetListTags_FilterType=="exif.Pentax"}selected{/if}>Exif [Pentax]</option> 196 208 <option value="xmp" {if $datas.config_GetListTags_FilterType=="xmp"}selected{/if}>Xmp</option> 197 209 <option value="iptc" {if $datas.config_GetListTags_FilterType=="iptc"}selected{/if}>Iptc</option> … … 212 224 <tr> 213 225 <th style="width:35%;min-width:340px;"><span id="iHLTOrderTag"></span><a onclick="sortTagList('tag');">{'g003_TagId'|@translate}</a></th> 214 <th> {'g003_TagLabel'|@translate}</th>226 <th><span id="iHLTOrderLabel"></span><a onclick="sortTagList('label');">{'g003_TagLabel'|@translate}</a></th> 215 227 <th width="80px"><span id="iHLTOrderNum"></span><a onclick="sortTagList('num');">{'g003_NumOfImage'|@translate}</a></th> 216 228 <th width="40px">{'g003_Pct'|@translate}</th> -
extensions/AMetaData/amd_aip.class.inc.php
r5191 r5226 307 307 if($_REQUEST['ajaxfct']=="showStatsGetListTags" and 308 308 !($_REQUEST['orderType']=="tag" or 309 $_REQUEST['orderType']=="label" or 309 310 $_REQUEST['orderType']=="num")) 310 311 { … … 321 322 $_REQUEST['filterType']=="magic" or 322 323 $_REQUEST['filterType']=="exif" or 324 $_REQUEST['filterType']=="exif.Canon" or 325 $_REQUEST['filterType']=="exif.Nikon" or 326 $_REQUEST['filterType']=="exif.Pentax" or 323 327 $_REQUEST['filterType']=="xmp" or 324 328 $_REQUEST['filterType']=="iptc")) … … 776 780 777 781 782 783 778 784 /* 779 785 * --------------------------------------------------------------------------- … … 989 995 990 996 $datas=array(); 991 $sql="SELECT ut.numId, ut.tagId, ut.translatable, ut.name, ut.numOfImg, if(st.tagId IS NULL, 'n', 'y') as checked 997 $sql="SELECT ut.numId, ut.tagId, ut.translatable, ut.name, ut.numOfImg, if(st.tagId IS NULL, 'n', 'y') as checked, ut.translatedName 992 998 FROM ".$this->tables['used_tags']." ut 993 999 LEFT JOIN ".$this->tables['selected_tags']." st … … 997 1003 if($filterType!='') 998 1004 { 999 $where.=" WHERE ut.tagId LIKE '".$filterType.".%' "; 1005 if($filterType=='exif') 1006 { 1007 $where.=" WHERE ut.tagId LIKE 'exif.tiff.%' 1008 OR ut.tagId LIKE 'exif.exif.%' 1009 OR ut.tagId LIKE 'exif.gps.%' "; 1010 } 1011 else 1012 { 1013 $where.=" WHERE ut.tagId LIKE '".$filterType.".%' "; 1014 } 1000 1015 } 1001 1016 … … 1021 1036 case 'num': 1022 1037 $sql.=" ORDER BY numOfImg DESC, tagId ASC"; 1038 break; 1039 case 'label': 1040 $sql.=" ORDER BY translatedName ASC, tagId ASC"; 1023 1041 break; 1024 1042 } … … 1086 1104 { 1087 1105 $datas[]=array( 1088 "value" => ($row['translatable']=='y')?L10n::get($row['value']):$row['value'],1106 "value" => $this->prepareValueForDisplay($row['value'], ($row['translatable']=='y'), ", "), 1089 1107 "nb" => $row['Nb'], 1090 1108 "pct" => ($row['numOfImg']!=0)?sprintf("%.2f", 100*$row['Nb']/$row['numOfImg']):"-" -
extensions/AMetaData/amd_install.class.inc.php
r5191 r5226 54 54 `name` varchar(200) NOT NULL default '', 55 55 `numOfImg` int(10) unsigned NOT NULL default '0', 56 `translatedName` varchar(200) NOT NULL default '', 56 57 PRIMARY KEY (`numId`), 57 58 KEY `by_tag` (`tagId`) … … 60 61 `imageId` mediumint(8) unsigned NOT NULL default '0', 61 62 `numId` int(10) unsigned NOT NULL default '0', 62 `value` varchar(255)default NULL,63 `value` text default NULL, 63 64 PRIMARY KEY USING BTREE (`imageId`,`numId`) 64 65 );", … … 127 128 { 128 129 global $template, $user; 129 130 L10n::setLanguage('en_UK'); 130 131 131 132 pwg_query("DELETE FROM ".$this->tables['used_tags']); … … 141 142 foreach(JpegMetaData::getTagList(Array('filter' => JpegMetaData::TAGFILTER_IMPLEMENTED, 'xmp' => true, 'maker' => true, 'iptc' => true)) as $key => $val) 142 143 { 143 $sql="INSERT INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0 );";144 $sql="INSERT INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0, '".L10n::get($val['name'])."');"; 144 145 pwg_query($sql); 145 146 } -
extensions/AMetaData/amd_pip.class.inc.php
r5183 r5226 125 125 $value=$picturesTags[$key]->getLabel(); 126 126 127 if($picturesTags[$key]->isTranslatable())128 $translatable="y";129 else130 $translatable="n";131 132 127 if($value instanceof DateTime) 133 128 { … … 155 150 ); 156 151 } 157 $md['lines'][L10n::get($picturesTags[$key]->getName())]=$ value;152 $md['lines'][L10n::get($picturesTags[$key]->getName())]=$this->prepareValueForDisplay($value, $picturesTags[$key]->isTranslatable()); 158 153 } 159 154 } -
extensions/AMetaData/amd_root.class.inc.php
r5183 r5226 26 26 include_once('JpegMetaData/JpegMetaData.class.php'); 27 27 include_once(JPEG_METADATA_DIR."Common/L10n.class.php"); 28 include_once(JPEG_METADATA_DIR."TagDefinitions/XmpTags.class.php"); 28 29 29 30 class AMD_root extends common_plugin … … 34 35 public function __construct($prefixeTable, $filelocation) 35 36 { 37 global $user; 36 38 $this->plugin_name="AMetaData"; 37 39 $this->plugin_name_files="amd"; … … 43 45 $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css"); 44 46 $this->jpegMD=new JpegMetaData(); 47 48 if(isset($user['language'])) 49 { 50 L10n::setLanguage($user['language']); 51 } 45 52 } 46 53 … … 271 278 272 279 280 /** 281 * This function : 282 * - convert arrays (stored as a serialized string) into human readable string 283 * - translate value in user language (if value is translatable) 284 * 285 * @param String $value : value to prepare 286 * @param Boolean $translatable : set to tru if the value can be translated in 287 * the user language 288 * @param String $separator : separator for arrays items 289 * @return String : the value prepared 290 */ 291 protected function prepareValueForDisplay($value, $translatable=true, $separator=", ") 292 { 293 global $user; 294 295 if(preg_match('/^a:\d+:\{.*\}$/is', $value)) 296 { 297 // $value is a serialized array 298 $tmp=unserialize($value); 299 300 if(count($tmp)==0) 301 { 302 return(L10n::get("Unknown")); 303 } 304 305 if(array_key_exists("computed", $tmp) and array_key_exists("detail", $tmp)) 306 { 307 /* keys 'computed' and 'detail' are present 308 * 309 * assume this is the 'exif.exif.Flash' metadata and return the computed 310 * value only 311 */ 312 return(L10n::get($tmp['computed'])); 313 } 314 elseif(array_key_exists("type", $tmp) and array_key_exists("values", $tmp)) 315 { 316 /* keys 'computed' and 'detail' are present 317 * 318 * assume this is an Xmp 'ALT', 'BAG' or 'SEQ' metadata and return the 319 * values only 320 */ 321 if($tmp['type']=='alt') 322 { 323 /* 'ALT' structure 324 * 325 * ==> assuming the structure is used only for multi language values 326 * 327 * Array( 328 * 'type' => 'ALT' 329 * 'values' => 330 * Array( 331 * Array( 332 * 'type' => Array( 333 * 'name' =>'xml:lang', 334 * 'value' => '' // language code 335 * ) 336 * 'value' => '' //value in the defined language 337 * ), 338 * 339 * Array( 340 * // data2 341 * ), 342 * 343 * ) 344 * ) 345 */ 346 $tmp=XmpTags::getAltValue($tmp, $user['language']); 347 if(trim($tmp)=="") $tmp="(".L10n::get("not defined").")"; 348 349 return($tmp); 350 } 351 else 352 { 353 /* 'SEQ' or 'BAG' structure 354 * 355 * Array( 356 * 'type' => 'XXX', 357 * 'values' => Array(val1, val2, .., valN) 358 * ) 359 */ 360 $tmp=$tmp['values']; 361 362 if(trim(implode("", $tmp))=="") 363 { 364 return("(".L10n::get("not defined").")"); 365 } 366 } 367 } 368 369 370 foreach($tmp as $key=>$val) 371 { 372 if(is_array($val)) 373 { 374 if($translatable) 375 { 376 foreach($val as $key2=>$val2) 377 { 378 $tmp[$key][$key2]=L10n::get($val2); 379 } 380 if(count($val)>0) 381 { 382 $tmp[$key]="[".implode($separator, $val)."]"; 383 } 384 else 385 { 386 unset($tmp[$key]); 387 } 388 } 389 } 390 else 391 { 392 if($translatable) 393 { 394 $tmp[$key]=L10n::get($val); 395 } 396 } 397 } 398 return(implode($separator, $tmp)); 399 } 400 else 401 { 402 if(trim($value)=="") 403 { 404 return("(".L10n::get("not defined").")"); 405 } 406 407 if(strpos($value, "|")>0) 408 { 409 $value=explode("|", $value); 410 if($translatable) 411 { 412 foreach($value as $key=>$val) 413 { 414 $value[$key]=L10n::get($val); 415 } 416 } 417 return(implode("", $value)); 418 } 419 420 if($translatable) 421 { 422 return(L10n::get($value)); 423 } 424 return($value); 425 } 426 } 427 273 428 } // amd_root class 274 429 -
extensions/AMetaData/language/fr_FR/description.txt
r4905 r5226 1 Advanced MetaData est un plugin permettant d'exploiter au maximum les métadonnées présentes dans les photos.1 Advanced MetaData est un plugin permettant d'exploiter au maximum les métadonnées (EXIF, IPTC et XMP) présentes dans les photos. -
extensions/AMetaData/language/fr_FR/plugin.lang.php
r5191 r5226 8 8 $lang['g003_error_invalid_ajax_call'] = "Appel de fonction invalide !"; 9 9 10 $lang['g003_stat'] = "Statistiques";11 10 $lang['g003_metadata'] = "Métadonnées"; 12 11 $lang['g003_database'] = "Référentiel"; 13 12 $lang['g003_status'] = "Status"; 14 13 $lang['g003_show'] = "Consulter"; 15 16 $lang['g003_performances'] = "Performances";17 $lang['g003_setting_nb_items_per_request'] = "Nombre d'images analysées par requêtes";18 $lang['g003_apply'] = "Appliquer";19 14 20 15 $lang['g003_numberOfAnalyzedPictures'] = "%d images ont fait l'objet d'une analyse et représentent %d métadonnées";
Note: See TracChangeset
for help on using the changeset viewer.