Changeset 7519
- Timestamp:
- Oct 31, 2010, 7:08:03 PM (13 years ago)
- Location:
- extensions/AMetaData
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/JpegMetaData/JpegMetaData.class.php
r7511 r7519 107 107 * | | | . Implement keywords as magic tag 108 108 * | | | 109 * | | | * mantis bug:1978 110 * | | | . Some meta names are not translated in french 109 111 * | | | 110 112 * | | | … … 796 798 return($num); 797 799 case "Author.Keywords": 798 $list=array_flip(array_flip(explode(',', str_replace(array('/', '|', ', 800 $list=array_flip(array_flip(explode(',', str_replace(array('/', '|', ','), ',', $value)))); 799 801 sort($list); 800 return(implode(',', $list)); 802 $tmp=array(); 803 foreach($list as $key=>$val) 804 { 805 if(trim($val)!='') $tmp[]=trim($val); 806 } 807 return($tmp); 801 808 break; 802 809 default: -
extensions/AMetaData/admin/amd_metadata_database_database.tpl
r7447 r7519 90 90 { 91 91 ignoreOptions.push('xmp'); 92 } 93 if($('#iFillDataBaseIgnore_com').get(0).checked) 94 { 95 ignoreOptions.push('com'); 92 96 } 93 97 … … 254 258 in_array('xmp', $amdConfig.amd_FillDataBaseExcludeFilters) and 255 259 in_array('iptc', $amdConfig.amd_FillDataBaseExcludeFilters) and 256 in_array('xmp', $amdConfig.amd_FillDataBaseExcludeFilters)) } 260 in_array('xmp', $amdConfig.amd_FillDataBaseExcludeFilters) and 261 in_array('com', $amdConfig.amd_FillDataBaseExcludeFilters)) } 257 262 <br> 258 263 {'g003_ignoreMetadata'|@translate}<br> … … 270 275 {/if} 271 276 {if !in_array('xmp', $amdConfig.amd_FillDataBaseExcludeFilters)} 272 <label><input onclick='displayAnalyzedOption();' type="checkbox" id='iFillDataBaseIgnore_xmp' {if in_array('xmp', $amdConfig.amd_FillDataBaseIgnoreSchemas)}checked{/if}> XMP</label> 277 <label><input onclick='displayAnalyzedOption();' type="checkbox" id='iFillDataBaseIgnore_xmp' {if in_array('xmp', $amdConfig.amd_FillDataBaseIgnoreSchemas)}checked{/if}> XMP</label><br> 278 {/if} 279 {if !in_array('com', $amdConfig.amd_FillDataBaseExcludeFilters)} 280 <label><input onclick='displayAnalyzedOption();' type="checkbox" id='iFillDataBaseIgnore_com' {if in_array('com', $amdConfig.amd_FillDataBaseIgnoreSchemas)}checked{/if}> COM</label> 273 281 {/if} 274 282 </td> -
extensions/AMetaData/admin/amd_metadata_database_status.tpl
r6950 r7519 1 1 <h2>{'g003_status_of_database'|@translate}</h2> 2 3 {if $datas.warning2!=''} 4 <div class="warnings"> 5 <p style="font-size: 120%;">{'g003_database_is_not_up_to_date'|@translate}</p> 6 {$datas.warning2} 7 </div> 8 {/if} 9 2 10 3 11 {if $amdConfig.amd_DisplayWarningsMessageStatus=='y'} … … 6 14 {$datas.warning1} 7 15 </div> 16 {/if} 8 17 9 18 <fieldset> … … 28 37 <li><span class="mdInfo">XMP</span>{$datas.nfoMetadata.xmp}</li> 29 38 {/if} 39 {if !in_array('com', $amdConfig.amd_FillDataBaseExcludeFilters)} 40 <li><span class="mdInfo">COM</span>{$datas.nfoMetadata.com}</li> 41 {/if} 30 42 <li><span class="mdInfo">{'g003_personnal'|@translate}</span>{$datas.nfoMetadata.userDefined}</li> 31 43 </ul> … … 45 57 46 58 47 {/if}48 59 -
extensions/AMetaData/admin/amd_metadata_select.tpl
r6950 r7519 224 224 <option value="iptc" {if $datas.config_GetListTags_FilterType=="iptc"}selected{/if}>Iptc</option> 225 225 {/if} 226 {if !in_array('com', $amdConfig.amd_FillDataBaseExcludeFilters)} 227 <option value="com" {if $datas.config_GetListTags_FilterType=="com"}selected{/if}>Com</option> 228 {/if} 226 229 </select> 227 230 </label> -
extensions/AMetaData/amd_aip.class.inc.php
r7447 r7519 558 558 $template->set_filename('sheet_page', dirname(__FILE__).'/admin/amd_metadata_database_status.tpl'); 559 559 560 $warning2=''; 561 $sql="SELECT tagId 562 FROM ".$this->tables['used_tags']." 563 WHERE newFromLastUpdate='y'"; 564 $result=pwg_query($sql); 565 if($result) 566 { 567 $tmp=array(); 568 $tagSchema=''; 569 while($row=pwg_db_fetch_assoc($result)) 570 { 571 if(preg_match('/^([a-z0-9]*)\..*/i', $row['tagId'], $tagSchema)) 572 { 573 if(!in_array($tagSchema[1],$this->config['amd_FillDataBaseIgnoreSchemas'])) $tmp[]=$row['tagId']; 574 } 575 } 576 if(count($tmp)>0) 577 { 578 $ul=''; 579 foreach($tmp as $val) 580 { 581 $ul.='<li>'.$val.'</li>'; 582 } 583 if(count($tmp)>1) 584 { 585 $warning2=sprintf(GPCCore::BBtoHTML(l10n('g003_databaseWarning2_n')),$ul); 586 } 587 else 588 { 589 $warning2=sprintf(GPCCore::BBtoHTML(l10n('g003_databaseWarning2_1')),$ul); 590 } 591 } 592 } 593 594 560 595 $datas=array( 561 596 'urlRequest' => $this->getAdminLink('ajax'), 597 'warning2' => $warning2, 562 598 'warning1' => GPCCore::BBtoHTML(l10n('g003_databaseWarning1')), 563 599 'nfoMetadata' => Array( … … 566 602 'magic' => 0, 567 603 'xmp' => 0, 604 'com' => 0, 568 605 'userDefined' => 0, 569 606 'numOfPictures' => 0, … … 591 628 FROM ".$this->tables['used_tags']." 592 629 WHERE tagId LIKE 'xmp.%' 630 UNION 631 SELECT SUM(numOfImg), 'com' 632 FROM ".$this->tables['used_tags']." 633 WHERE tagId LIKE 'com.%' 593 634 UNION 594 635 SELECT SUM(numOfImg), 'userDefined' … … 619 660 $row['type']=='magic' or 620 661 $row['type']=='xmp' or 662 $row['type']=='com' or 621 663 $row['type']=='userDefined') $datas['nfoMetadata']['nfoRows']+=$row['nb']; 622 664 } -
extensions/AMetaData/amd_aip_install.class.inc.php
r7399 r7519 174 174 'magic.Author.Copyright', 175 175 'magic.Author.ImageTitle', 176 'magic.Author.Keywords', 176 177 'magic.GPS.Altitude', 177 178 'magic.GPS.Latitude', -
extensions/AMetaData/amd_ajax.php
r7447 r7519 162 162 ($_REQUEST['filterType']=="exif.maker.Pentax" and !in_array('maker', $this->config['amd_FillDataBaseExcludeFilters'])) or 163 163 ($_REQUEST['filterType']=="xmp" and !in_array('xmp', $this->config['amd_FillDataBaseExcludeFilters'])) or 164 ($_REQUEST['filterType']=="iptc" and !in_array('iptc', $this->config['amd_FillDataBaseExcludeFilters'])) 164 ($_REQUEST['filterType']=="iptc" and !in_array('iptc', $this->config['amd_FillDataBaseExcludeFilters'])) or 165 ($_REQUEST['filterType']=="com" and !in_array('com', $this->config['amd_FillDataBaseExcludeFilters'])) 165 166 )) $_REQUEST['filterType']=""; 166 167 … … 659 660 * @param String $orderType : order for the list (by tag 'tag' or by number of 660 661 * pictures 'num') 661 * @param String $filterType : filter for the list ('exif', 'xmp', 'iptc' or '')662 * @param String $filterType : filter for the list ('exif', 'xmp', 'iptc', 'com' or '') 662 663 * @return String 663 664 */ … … 1533 1534 paut.tagId = 'xmp.digiKam:TagsList' OR 1534 1535 paut.tagId = 'xmp.lr:hierarchicalSubject' OR 1535 paut.tagId = 'iptc.Keywords');"; 1536 paut.tagId = 'iptc.Keywords' OR 1537 paut.tagId = 'magic.Author.Keywords');"; 1536 1538 $result=pwg_query($sql); 1537 1539 if($result) … … 1545 1547 */ 1546 1548 $tmp=unserialize($row['value']); 1549 if(!isset($tmp['values'])) $tmp=array('values'=>$tmp); 1547 1550 foreach($tmp['values'] as $val) 1548 1551 { … … 1636 1639 paut.tagId = 'xmp.digiKam:TagsList' OR 1637 1640 paut.tagId = 'xmp.lr:hierarchicalSubject' OR 1638 paut.tagId = 'iptc.Keywords');"; 1641 paut.tagId = 'iptc.Keywords' OR 1642 paut.tagId = 'magic.Author.Keywords');"; 1639 1643 $result=pwg_query($sql); 1640 1644 if($result) … … 1648 1652 */ 1649 1653 $tmp=unserialize($row['value']); 1654 if(!isset($tmp['values'])) $tmp=array('values'=>$tmp); 1650 1655 foreach($tmp['values'] as $val) 1651 1656 { 1652 if($row['tagId']=='xmp.digiKam:TagsList' )1657 if($row['tagId']=='xmp.digiKam:TagsList' or $row['tagId']=='xmp.lr:hierarchicalSubject') 1653 1658 { 1654 1659 $list=explode($this->tagSeparators[$row['tagId']], $val); -
extensions/AMetaData/amd_install.class.inc.php
r7399 r7519 47 47 $this->initConfig(); 48 48 $this->loadConfig(); 49 $this->config['amd_FillDataBaseIgnoreSchemas']=> array('exif', 'iptc', 'xmp', 'com'); 49 50 $this->config['installed']=AMD_VERSION2; 50 51 $this->config['newInstall']='y'; … … 59 60 `numOfImg` int(10) unsigned NOT NULL default '0', 60 61 `translatedName` varchar(200) NOT NULL default '', 62 `newFromLastUpdate` char(1) NOT NULL default 'n', 61 63 PRIMARY KEY (`numId`), 62 64 KEY `by_tag` (`tagId`) … … 177 179 $this->config['newInstall']='n'; 178 180 $this->updateFrom_000400(); 179 break; 181 case '00.05.01': 182 case '00.05.02': 183 $this->config['newInstall']='n'; 184 $this->updateFrom_000502(); 180 185 default: 181 186 /* … … 183 188 * database with default values 184 189 */ 185 $this-> initializeDatabase();190 $this->fillDatabase(); 186 191 break; 187 192 } … … 247 252 } 248 253 249 254 /** 255 * update the database from the release 0.5.2 256 */ 257 private function updateFrom_000502() 258 { 259 /* 260 * alter existing tables 261 */ 262 $tablesUpdate=array( 263 $this->tables['used_tags'] => array( 264 'newFromLastUpdate' => "ADD COLUMN `newFromLastUpdate` CHAR(1) NOT NULL DEFAULT 'n' AFTER `translatedName`", 265 ) 266 ); 267 268 $tablef=new GPCTables(array($this->tables['used_tags'])); 269 270 if(count($tablesUpdate)>0) $tablef->updateTablesFields($tablesUpdate); 271 272 unset($tablesUpdate); 273 } 250 274 251 275 … … 253 277 * fill the database with some default value 254 278 */ 255 private function initializeDatabase() 279 private function fillDatabase() 280 { 281 if($this->config['newInstall']=='y') 282 { 283 $this->initializeDatabaseContent(); 284 } 285 else 286 { 287 $this->updateDatabaseContent(); 288 } 289 } 290 291 /** 292 * reset and initialize the database content (for a fresh install) 293 */ 294 private function initializeDatabaseContent() 256 295 { 257 296 global $user; … … 269 308 * fill the 'used_tags' table with default values 270 309 */ 271 foreach(AMD_JpegMetaData::getTagList(Array('filter' => AMD_JpegMetaData::TAGFILTER_IMPLEMENTED, 'xmp' => true, 'maker' => true, 'iptc' => true)) as $key => $val) 272 { 273 $sql="INSERT INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0, '".addslashes(L10n::get($val['name']))."');"; 310 foreach(AMD_JpegMetaData::getTagList( 311 Array('filter' => AMD_JpegMetaData::TAGFILTER_IMPLEMENTED, 312 'xmp' => true, 313 'maker' => true, 314 'iptc' => true, 315 'com' => true) 316 ) as $key => $val 317 ) 318 { 319 $sql="INSERT INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0, '".addslashes(L10n::get($val['name']))."', 'n');"; 274 320 pwg_query($sql); 275 321 } … … 292 338 } 293 339 340 /** 341 * update the database content (for an update) 342 */ 343 private function updateDatabaseContent() 344 { 345 global $user; 346 347 L10n::setLanguage('en_UK'); 348 349 pwg_query("INSERT INTO ".$this->tables['images']." 350 SELECT id, 'n', 0 351 FROM ".IMAGES_TABLE." 352 WHERE id NOT IN (SELECT imageId FROM ".$this->tables['images'].")"); 353 354 $tagList=array(); 355 $sql="SELECT tagId FROM ".$this->tables['used_tags']; 356 $result=pwg_query($sql); 357 if($result) 358 { 359 while($row=pwg_db_fetch_row($result)) 360 { 361 $tagList[$row[0]]=''; 362 } 363 } 364 365 /* 366 * fill the 'used_tags' table with default values 367 */ 368 foreach(AMD_JpegMetaData::getTagList( 369 Array('filter' => AMD_JpegMetaData::TAGFILTER_IMPLEMENTED, 370 'xmp' => true, 371 'maker' => true, 372 'iptc' => true, 373 'com' => true) 374 ) as $key => $val 375 ) 376 { 377 if(!array_key_exists($key, $tagList)) 378 { 379 $sql="INSERT IGNORE INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0, '".addslashes(L10n::get($val['name']))."', 'y');"; 380 pwg_query($sql); 381 } 382 } 383 384 /* 385 * exclude unauthorized tag with the 'amd_FillDataBaseExcludeTags' option 386 */ 387 if(count($this->config['amd_FillDataBaseExcludeTags'])) 388 { 389 $sql=""; 390 foreach($this->config['amd_FillDataBaseExcludeTags'] as $key => $tag) 391 { 392 if($sql!="") $sql.=" OR "; 393 $sql.=" tagId LIKE '$tag' "; 394 } 395 $sql="DELETE FROM ".$this->tables['used_tags']." 396 WHERE ".$sql; 397 pwg_query($sql); 398 } 399 } 400 401 294 402 private function buildDefaultGroup() 295 403 { -
extensions/AMetaData/amd_root.class.inc.php
r6950 r7519 37 37 { 38 38 global $user; 39 $this->setPluginName("A MetaData");39 $this->setPluginName("Advanced MetaData"); 40 40 $this->setPluginNameFiles("amd"); 41 41 parent::__construct($prefixeTable, $filelocation); … … 111 111 * 'iptc', 112 112 * 'xmp', 113 * 'magic') 113 * 'magic', 114 * 'com') 114 115 * 115 116 * ==> amd_DisplayWarningsMessageStatus : 'y' or 'n' … … 240 241 'xmp' => !isset($schemas['xmp']), 241 242 'magic' => !isset($schemas['magic']), 243 'com' => !isset($schemas['com']), 242 244 ) 243 245 ); … … 582 584 583 585 } 586 print_r($this->config['amd_FillDataBaseIgnoreSchemas']); 584 587 $this->saveConfig(); 585 588 } -
extensions/AMetaData/amd_version.inc.php
r7036 r7519 17 17 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 18 18 19 define('AMD_VERSION', '0.5. 2');20 define('AMD_VERSION2', '00.05.0 2');19 define('AMD_VERSION', '0.5.3'); 20 define('AMD_VERSION2', '00.05.03'); 21 21 define('AMD_GPC_NEEDED', '3.2.0'); 22 22 ?> -
extensions/AMetaData/language/en_UK/plugin.lang.php
r7447 r7519 1 1 <?php 2 2 /* 3 * How to translate metadata names and values ? 4 * 5 * Metadata names and values are not translated with a /language/*.lang.php file 6 * but they are stored in a .po and .mo files, respectively localized into 7 * - /JpegMetaData/Locale/xx_XX/Tag.po 8 * - /JpegMetaData/Locale/xx_XX/LC_MESSAGES/Tag.mo 9 * 10 * More information about GNU gettext l10n system and method to edit the .po & .mo 11 * files on wikipedia : 12 * - http://en.wikipedia.org/wiki/GNU_gettext 13 * 14 */ 3 15 4 16 $lang['Grum Plugin Classes is not installed'] = '<b>Grum Plugin Classes</b> plugin is not installed'; … … 343 355 344 356 345 346 357 $lang['g003_database_is_not_up_to_date']="The repository is not up do date !"; 358 $lang['g003_databaseWarning2_1']="[p]A new metadata is available since the last update of the plugin:[/p][ul]%s[/ul] 359 [p] 360 To be exploited, it is necessary to update the repository.[/p]"; 361 $lang['g003_databaseWarning2_n']="[p]Some new metadatas are available since the last update of the plugin:[/p][ul]%s[/ul] 362 [p] 363 To be exploited, it is necessary to update the repository.[/p]"; 364 365 // help for metadata translation is given at the beginning of this file 347 366 348 367 ?> -
extensions/AMetaData/language/es_ES/plugin.lang.php
r7035 r7519 1 1 <?php 2 /* 3 * How to translate metadata names and values ? 4 * 5 * Metadata names and values are not translated with a /language/*.lang.php file 6 * but they are stored in a .po and .mo files, respectively localized into 7 * - /JpegMetaData/Locale/xx_XX/Tag.po 8 * - /JpegMetaData/Locale/xx_XX/LC_MESSAGES/Tag.mo 9 * 10 * More information about GNU gettext l10n system and method to edit the .po & .mo 11 * files on wikipedia : 12 * - http://en.wikipedia.org/wiki/GNU_gettext 13 * 14 */ 2 15 3 16 $lang['Grum Plugin Classes is not installed'] = 'El plugin <b>Grum Plugin Classes</b> no esta instalado'; … … 16 29 $lang['g003_performances'] = "Rendimiento"; 17 30 $lang['g003_setting_nb_items_per_request'] = "Numero de imágenes analizadas por demandas"; 18 $lang['g003_apply'] = "A fficher en écriture latineAplicar";31 $lang['g003_apply'] = "Aplicar"; 19 32 20 33 $lang['g003_numberOfAnalyzedPictures'] = "%d imágenes han sido objeto de un análisis y representan %d métadatos"; … … 326 339 327 340 341 /** ---------------------------------------------------------------------------- 342 * new keys from releases 0.5.3 343 * 344 * 345 * need to be translated 346 * thanks :) 347 */ 348 $lang['g003_1_picture_in_caddie']="1 picture in caddie"; 349 $lang['g003_n_pictures_in_caddie']="%s pictures in caddie"; 350 $lang['g003_analyze_random_pictures'] = "The analysis focuses on %s images selected randomly among images that have never been analyzed, and adds to the existing repository"; 351 $lang['g003_invalid_random_number']="The number of images to process is not valid"; 352 353 354 $lang['g003_database_is_not_up_to_date']="The repository is not up do date !"; 355 $lang['g003_databaseWarning2_1']="[p]A new metadata is available since the last update of the plugin:[/p][ul]%s[/ul] 356 [p] 357 To be exploited, it is necessary to update the repository.[/p]"; 358 $lang['g003_databaseWarning2_n']="[p]Some new metadatas are available since the last update of the plugin:[/p][ul]%s[/ul] 359 [p] 360 To be exploited, it is necessary to update the repository.[/p]"; 361 362 // help for metadata translation is given at the beginning of this file 328 363 329 364 ?> -
extensions/AMetaData/language/fr_FR/plugin.lang.php
r7448 r7519 1 1 <?php 2 3 /* 4 * How to translate metadata names and values ? 5 * 6 * Metadata names and values are not translated with a /language/*.lang.php file 7 * but they are stored in a .po and .mo files, respectively localized into 8 * - /JpegMetaData/Locale/xx_XX/Tag.po 9 * - /JpegMetaData/Locale/xx_XX/LC_MESSAGES/Tag.mo 10 * 11 * More information about GNU gettext l10n system and method to edit the .po & .mo 12 * files on wikipedia : 13 * - http://en.wikipedia.org/wiki/GNU_gettext 14 * 15 */ 2 16 3 17 $lang['Grum Plugin Classes is not installed'] = 'Le plugin <b>Grum Plugin Classes</b> n\'est pas installé'; … … 341 355 $lang['g003_invalid_random_number']="Le nombre de photos à traiter est invalide"; 342 356 357 $lang['g003_database_is_not_up_to_date']="Le référentiel n'est pas à jour !"; 358 $lang['g003_databaseWarning2_1']="[p]Une nouvelle métadonnée est accessible suite à la dernière mise à jour du plugin :[/p][ul]%s[/ul] 359 [p] 360 Pour qu'elle puisse être exploitée, il est nécessaire de procéder à la mise à jour du référentiel.[/p]"; 361 $lang['g003_databaseWarning2_n']="[p]De nouvelles métadonnées sont accessibles suite à la dernière mise à jour du plugin :[/p][ul]%s[/ul] 362 [p] 363 Pour qu'elles puissent être exploitées, il est nécessaire de procéder à la mise à jour du référentiel.[/p]"; 364 365 // help for metadata translation is given at the beginning of this file 343 366 344 367 -
extensions/AMetaData/main.inc.php
r7447 r7519 2 2 /* 3 3 Plugin Name: Advanced MetaData 4 Version: 0.5. 24 Version: 0.5.3 5 5 Description: An advanced metadata manager 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=364 … … 126 126 | | | new package 127 127 | | | 128 | 0. x.y| 2010/09/30 | * mantis bug:1894128 | 0.5.3 | 2010/09/30 | * mantis bug:1894 129 129 | | | . Error when filling the metadata repository 130 130 | | | … … 163 163 | | | * mantis bug:1294 164 164 | | | . filling database method 165 | | | 166 | | | * mantis bug:1975 167 | | | . Implement COM segment as a tag 168 | | | 169 | | | * mantis bug:1976 170 | | | . Implement keywords as magic tag 171 | | | 172 | | | * mantis bug:1978 173 | | | . Some meta names are not translated in french 174 | | | 165 175 | | | 166 176 | | |
Note: See TracChangeset
for help on using the changeset viewer.