Changeset 7447
- Timestamp:
- Oct 28, 2010, 1:30:33 AM (14 years ago)
- Location:
- extensions/AMetaData
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/admin/amd_metadata_database_database.tpl
r6950 r7447 24 24 function doAnalyze() 25 25 { 26 mode="all"; 27 modeLabel=""; 28 29 if($("#ianalyze_action0").get(0).checked) 30 { 31 mode="notAnalyzed"; 32 modeLabel="{/literal}{'g003_analyze_not_analyzed_pictures'|@translate}{literal}"; 33 } 34 else if($("#ianalyze_action1").get(0).checked) 35 { 36 mode="all"; 37 modeLabel="{/literal}{'g003_analyze_all_pictures'|@translate}{literal}"; 38 } 39 else if($("#ianalyze_action2").get(0).checked) 40 { 41 mode="caddieAdd"; 42 modeLabel="{/literal}{'g003_analyze_caddie_add_pictures'|@translate}{literal}"; 43 } 44 else if($("#ianalyze_action3").get(0).checked) 45 { 46 mode="caddieReplace"; 47 modeLabel="{/literal}{'g003_analyze_caddie_replace_pictures'|@translate}{literal}"; 48 } 49 else if($("#ianalyze_action4").get(0).checked) 50 { 51 mode="analyzed"; 52 modeLabel="{/literal}{'g003_analyze_analyzed_pictures'|@translate}{literal}"; 53 } 54 55 ignoreOptions=[]; 56 if($('#iFillDataBaseIgnore_magic').get(0).checked) 57 { 58 ignoreOptions.push('magic'); 59 } 60 if($('#iFillDataBaseIgnore_exif').get(0).checked) 61 { 62 ignoreOptions.push('exif'); 63 } 64 if($('#iFillDataBaseIgnore_iptc').get(0).checked) 65 { 66 ignoreOptions.push('iptc'); 67 } 68 if($('#iFillDataBaseIgnore_xmp').get(0).checked) 69 { 70 ignoreOptions.push('xmp'); 71 } 72 73 74 doAnalyzeDialog="<br><form id='iDialogProgress' class='formtable'>"+ 26 var mode="all", 27 modeLabel="", 28 numOfRandomItems=0, 29 doAnalyzeDialog="<br><form id='iDialogProgress' class='formtable'>"+ 75 30 "<div id='iprogressbar_contener' class='gcBorderInput'>"+ 76 31 "<span id='iprogressbar_bg' class='gcBgInput' style='width:0%;'> </span>"+ 77 32 "<span id='iprogressbar_fg' class='gcLink'>0%</span>"+ 78 33 "</div><p>{/literal}{'g003_analyze_in_progress'|@translate}{literal}"+ 79 "<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>" 80 "</p></form>"; 34 "<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>"+ 35 "</p></form>", 36 re=/^\d+$/; 37 38 39 if($("#ianalyze_action0").get(0).checked) 40 { 41 mode="notAnalyzed"; 42 modeLabel="{/literal}{'g003_analyze_not_analyzed_pictures'|@translate}{literal}"; 43 } 44 else if($("#ianalyze_action1").get(0).checked) 45 { 46 mode="all"; 47 modeLabel="{/literal}{'g003_analyze_all_pictures'|@translate}{literal}"; 48 } 49 else if($("#ianalyze_action2").get(0).checked) 50 { 51 mode="caddieAdd"; 52 modeLabel="{/literal}{'g003_analyze_caddie_add_pictures'|@translate}{literal}"; 53 } 54 else if($("#ianalyze_action3").get(0).checked) 55 { 56 mode="caddieReplace"; 57 modeLabel="{/literal}{'g003_analyze_caddie_replace_pictures'|@translate}{literal}"; 58 } 59 else if($("#ianalyze_action4").get(0).checked) 60 { 61 mode="analyzed"; 62 modeLabel="{/literal}{'g003_analyze_analyzed_pictures'|@translate}{literal}"; 63 } 64 else if($("#ianalyze_action5").get(0).checked) 65 { 66 mode="randomList"; 67 numOfRandomItems=$("#ianalyze_action6").val(); 68 if(numOfRandomItems<=0 || re.exec(numOfRandomItems)==null) 69 { 70 alert("{/literal}{'g003_invalid_random_number'|@translate}{literal}"); 71 return(false); 72 } 73 modeLabel="{/literal}{'g003_analyze_random_pictures'|@translate|replace:'%s':'"+numOfRandomItems+"'}{literal}"; 74 } 75 76 ignoreOptions=[]; 77 if($('#iFillDataBaseIgnore_magic').get(0).checked) 78 { 79 ignoreOptions.push('magic'); 80 } 81 if($('#iFillDataBaseIgnore_exif').get(0).checked) 82 { 83 ignoreOptions.push('exif'); 84 } 85 if($('#iFillDataBaseIgnore_iptc').get(0).checked) 86 { 87 ignoreOptions.push('iptc'); 88 } 89 if($('#iFillDataBaseIgnore_xmp').get(0).checked) 90 { 91 ignoreOptions.push('xmp'); 92 } 93 81 94 82 95 $("#dialog") … … 107 120 numOfItems:NumberOfItemsPerRequest, 108 121 ignoreOptions:ignoreOptions, 122 numOfRandomItems:numOfRandomItems, 109 123 }, 110 124 success: function(msg) … … 267 281 <fieldset> 268 282 <legend>{'g003_update_metadata'|@translate}</legend> 269 <label> 270 <input type="radio" value="caddieAdd" name="fAMD_analyze_action" id="ianalyze_action2" checked> 271 {'g003_analyze_caddie_add_pictures'|@translate} 272 </label><br> 273 274 <label> 275 <input type="radio" value="caddieReplace" name="fAMD_analyze_action" id="ianalyze_action3"> 276 {'g003_analyze_caddie_replace_pictures'|@translate} 277 </label><br> 278 283 <div> 284 <div style='display: inline-block; border-right: 1px dotted; margin-right: 4px; padding-right: 8px;'> 285 <label> 286 <input type="radio" value="caddieAdd" name="fAMD_analyze_action" id="ianalyze_action2" checked> 287 {'g003_analyze_caddie_add_pictures'|@translate} 288 </label><br> 289 290 <label> 291 <input type="radio" value="caddieReplace" name="fAMD_analyze_action" id="ianalyze_action3"> 292 {'g003_analyze_caddie_replace_pictures'|@translate} 293 </label><br> 294 </div> 295 <span style='font-style: italic; position: relative; top: -12px;'>{$datas.caddieNbPictures}</span> 296 </div> 279 297 280 298 <label> … … 287 305 {'g003_analyze_all_pictures'|@translate} 288 306 </label><br> 307 308 309 310 <input type="radio" value="randomList" name="fAMD_analyze_action" id="ianalyze_action5"> 311 {'g003_analyze_random_pictures'|@translate|replace:'%s':"<input type='text' size='4' id='ianalyze_action6' value='500' style='display:inline;' onfocus='$("#ianalyze_action5").attr("checked", true);'>"} 312 <br> 313 289 314 290 315 <span id='iAnalyzeAnalyzed' style='display:none;'> -
extensions/AMetaData/amd_aip.class.inc.php
r6950 r7447 667 667 private function displayDatabaseDatabase() 668 668 { 669 global $template, $page ;669 global $template, $page, $user; 670 670 671 671 /* … … 700 700 701 701 702 $caddieNbPictures=0; 703 $sql="SELECT COUNT(element_id) AS nbPictures 704 FROM ".CADDIE_TABLE." 705 WHERE user_id='".$user['id']."';"; 706 $result=pwg_query($sql); 707 if($result) 708 { 709 while($row=pwg_db_fetch_assoc($result)) 710 { 711 $caddieNbPictures=$row['nbPictures']; 712 } 713 } 702 714 703 715 … … 707 719 'urlRequest' => $this->getAdminLink('ajax'), 708 720 'NumberOfItemsPerRequest' => $this->config['amd_NumberOfItemsPerRequest'], 721 'caddieNbPictures' => ($caddieNbPictures==1)?l10n('g003_1_picture_in_caddie'):sprintf(l10n('g003_n_pictures_in_caddie'), $caddieNbPictures) 709 722 ); 710 723 -
extensions/AMetaData/amd_ajax.php
r7443 r7447 109 109 $_REQUEST['selectMode']=="caddieReplace" or 110 110 $_REQUEST['selectMode']=="analyzed" or 111 $_REQUEST['selectMode']=="randomList" or 111 112 $_REQUEST['selectMode']=="all")) $_REQUEST['selectMode']="caddieAdd"; 113 114 if($_REQUEST['selectMode']=="randomList" and 115 (!isset($_REQUEST['numOfRandomItems']) or 116 $_REQUEST['numOfRandomItems']<=0 or 117 preg_match('/^\d+$/', $_REQUEST['numOfRandomItems'])==0 118 ) 119 ) $_REQUEST['ajaxfct']=''; 120 112 121 113 122 if(!isset($_REQUEST['numOfItems'])) $_REQUEST['numOfItems']=25; … … 358 367 { 359 368 case 'admin.makeStats.getList': 360 $result=$this->ajax_amd_admin_makeStatsGetList($_REQUEST['selectMode'], $_REQUEST['numOfItems'], $_REQUEST['ignoreOptions'] );369 $result=$this->ajax_amd_admin_makeStatsGetList($_REQUEST['selectMode'], $_REQUEST['numOfItems'], $_REQUEST['ignoreOptions'], $_REQUEST['numOfRandomItems']); 361 370 break; 362 371 case 'admin.makeStats.doAnalyze': … … 508 517 * @param String $mode 509 518 * @param Integer $nbOfItems : number of items per request 519 * @param 520 * @param Integer $numOfRandomItems : number of random items (used if $mode=='randomList') 510 521 * @return String : list of image id to be analyzed, separated with a space 511 522 * "23 78 4523 5670" 512 523 */ 513 private function ajax_amd_admin_makeStatsGetList($mode, $nbOfItems, $ignoreSchemas )524 private function ajax_amd_admin_makeStatsGetList($mode, $nbOfItems, $ignoreSchemas, $numOfRandomItems) 514 525 { 515 526 global $user; … … 521 532 522 533 $sql="SELECT ait.imageId FROM ".$this->tables['images']." ait"; 523 if($mode=='notAnalyzed' )534 if($mode=='notAnalyzed' or $mode=='randomList' ) 524 535 { 525 536 $sql.=" WHERE ait.analyzed='n'"; … … 546 557 pwg_query("UPDATE ".$this->tables['used_tags']." SET numOfImg=0"); 547 558 pwg_query("DELETE FROM ".$this->tables['images_tags']); 559 } 560 561 if($mode=='randomList') 562 { 563 $sql.=" ORDER BY RAND() LIMIT 0, $numOfRandomItems;"; 548 564 } 549 565 -
extensions/AMetaData/language/en_UK/plugin.lang.php
r7035 r7447 18 18 $lang['g003_analyze_not_analyzed_pictures'] = "The analysis focuses on the images that have never been analyzed, and adds to the existing repository"; 19 19 $lang['g003_analyze_all_pictures'] = "The analysis includes all the images in the gallery, and replaces the current repository"; 20 $lang['g003_analyze_caddie_add_pictures'] = "The analysis focuses on the images in the basket, and adds to the existing repository";21 $lang['g003_analyze_caddie_replace_pictures'] = "The analysis focuses on the images in the basket, and replaces the current repository";20 $lang['g003_analyze_caddie_add_pictures'] = "The analysis focuses on the images in the caddie, and adds to the existing repository"; 21 $lang['g003_analyze_caddie_replace_pictures'] = "The analysis focuses on the images in the caddie, and replaces the current repository"; 22 22 $lang['g003_analyze'] = "Analyze"; 23 23 $lang['g003_update_metadata'] = "Update metadata repository"; … … 334 334 335 335 336 /** ---------------------------------------------------------------------------- 337 * new keys from releases 0.5.3 338 */ 339 $lang['g003_1_picture_in_caddie']="1 picture in caddie"; 340 $lang['g003_n_pictures_in_caddie']="%s pictures in caddie"; 341 $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"; 342 $lang['g003_invalid_random_number']="The number of images to process is not valid"; 343 344 336 345 337 346 -
extensions/AMetaData/main.inc.php
r7444 r7447 161 161 | | | displayed 162 162 | | | 163 | | | 164 | | | 163 | | | * mantis bug:1294 164 | | | . filling database method 165 165 | | | 166 166 | | |
Note: See TracChangeset
for help on using the changeset viewer.