Changeset 5959 for extensions/AMetaData
- Timestamp:
- Apr 25, 2010, 1:22:40 AM (14 years ago)
- Location:
- extensions/AMetaData
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/admin/amd_help.tpl
r5191 r5959 1 1 {$statTabsheet} 2 2 3 <h 3>{'g003_metadata'|@translate} {$data.title}</h3>3 <h2>{'g003_metadata'|@translate} {$data.title}</h2> 4 4 5 5 <div id="helpBody"> -
extensions/AMetaData/admin/amd_metadata_database.tpl
r5935 r5959 1 1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 2 {known_script id="jquery.ui.slider" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.slider.packed.js"}3 2 {known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"} 4 5 3 6 4 {literal} 7 5 <script type="text/javascript"> 6 var processAnalyze = { 7 step:0, 8 lists:new Array(), 9 timeStart:0, 10 timeEnd:0 11 } 8 12 9 13 function init() … … 45 49 function doAnalyze() 46 50 { 47 $("body").css("cursor", "wait");48 49 51 mode="all"; 50 52 modeLabel=""; … … 72 74 73 75 74 doAnalyze ="<br><form id='iDialogProgress' class='formtable'>"+76 doAnalyzeDialog="<br><form id='iDialogProgress' class='formtable'>"+ 75 77 "<div id='iprogressbar_contener' class='gcBorderInput'>"+ 76 78 "<span id='iprogressbar_bg' class='gcBgInput' style='width:0%;'> </span>"+ … … 92 94 title: '{/literal}{"g003_updating_metadata"|@translate}{literal} ('+modeLabel+')', 93 95 } 94 ).html(doAnalyze );96 ).html(doAnalyzeDialog); 95 97 96 98 NumberOfItemsPerRequest=$("#iamd_NumberOfItemsPerRequest").val(); … … 100 102 type: "POST", 101 103 url: "{/literal}{$datas.urlRequest}{literal}", 102 async: false,104 async: true, 103 105 data: { ajaxfct:"makeStatsGetList", selectMode:mode, numOfItems:NumberOfItemsPerRequest }, 104 106 success: function(msg) 105 107 { 106 doStep_getList(msg); 108 processAnalyze.step=0; 109 processAnalyze.lists=msg.split(";"); 110 processAnalyze.timeStart=new Date(); 111 doStep_processList(); 107 112 }, 108 113 error: function() … … 124 129 } 125 130 126 function doStep_getList(data) 127 { 128 timeStart = new Date(); 129 list=data.split(";"); 130 for(i=0;i<list.length-1;i++) 131 function doStep_processList() 132 { 133 if(processAnalyze.step < processAnalyze.lists.length) 131 134 { 132 135 tmp = $.ajax({ 133 136 type: "POST", 134 137 url: "{/literal}{$datas.urlRequest}{literal}", 135 async: false, 136 data: { ajaxfct:"makeStatsDoAnalyze", imagesList:list[i] } 137 }).responseText; 138 139 pct=100*(i+1)/list.length; 138 async: true, 139 data: { ajaxfct:"makeStatsDoAnalyze", imagesList:processAnalyze.lists[processAnalyze.step] }, 140 success: function(msg) 141 { 142 processAnalyze.step++; 143 doStep_processList(); 144 }, 145 }); 146 147 pct=100*(processAnalyze.step+1)/processAnalyze.lists.length; 140 148 $("#iprogressbar_bg").css("width", pct+"%"); 141 149 $("#iprogressbar_fg").html(Math.round(pct)+"%"); 142 150 } 143 144 tmp = $.ajax({ 145 type: "POST", 146 url: "{/literal}{$datas.urlRequest}{literal}", 147 async: false, 148 data: { ajaxfct:"makeStatsConsolidation" } 149 }).responseText; 150 151 152 timeEnd = new Date(); 153 timeElapsed=timeEnd.getTime()-timeStart.getTime(); 154 155 156 $("#dialog") 157 .dialog("destroy") 158 .html("") 159 .get(0).removeAttribute('style'); 160 161 $("#dialog") 162 .dialog( 163 { 164 resizable: false, 165 width:480, 166 height:120, 167 modal: true, 168 draggable:true, 169 dialogClass: 'gcBgTabSheet gcBorder', 170 title: '{/literal}{"g003_updating_metadata"|@translate}{literal}', 171 dialogClass: 'gcBgTabSheet gcBorder', 172 open: function(event, ui) 151 else 152 { 153 // list completely processed 154 155 tmp = $.ajax({ 156 type: "POST", 157 url: "{/literal}{$datas.urlRequest}{literal}", 158 async: false, 159 data: { ajaxfct:"makeStatsConsolidation" } 160 }).responseText; 161 162 163 processAnalyze.timeEnd = new Date(); 164 timeElapsed=processAnalyze.timeEnd.getTime()-processAnalyze.timeStart.getTime(); 165 166 167 $("#dialog") 168 .dialog("destroy") 169 .html("") 170 .get(0).removeAttribute('style'); 171 172 $("#dialog") 173 .dialog( 173 174 { 174 bH=$("div.ui-dialog-buttonpane").get(0).clientHeight; 175 $("#dialog").css('height', (this.clientHeight-bH)+"px"); 176 }, 177 buttons: 178 { 179 '{/literal}{"g003_ok"|@translate}{literal}': 180 function() 181 { 182 $(this).dialog('destroy').html("").get(0).removeAttribute('style'); 183 } 175 resizable: false, 176 width:480, 177 height:120, 178 modal: true, 179 draggable:true, 180 dialogClass: 'gcBgTabSheet gcBorder', 181 title: '{/literal}{"g003_updating_metadata"|@translate}{literal}', 182 dialogClass: 'gcBgTabSheet gcBorder', 183 open: function(event, ui) 184 { 185 bH=$("div.ui-dialog-buttonpane").get(0).clientHeight; 186 $("#dialog").css('height', (this.clientHeight-bH)+"px"); 187 }, 188 buttons: 189 { 190 '{/literal}{"g003_ok"|@translate}{literal}': 191 function() 192 { 193 $(this).dialog('destroy').html("").get(0).removeAttribute('style'); 194 } 195 } 184 196 } 185 } 186 ) 187 .html("<br>{/literal}{'g003_analyze_is_finished'|@translate}{literal} ("+displayTime(timeElapsed/1000)+")"); 188 189 getStatus(); 190 $("body").css("cursor", "default"); 197 ) 198 .html("<br>{/literal}{'g003_analyze_is_finished'|@translate}{literal} ("+displayTime(timeElapsed/1000)+")"); 199 200 getStatus(); 201 } 191 202 } 192 203 … … 196 207 {/literal} 197 208 198 <h 3>{'g003_status_of_database'|@translate}</h3>209 <h2>{'g003_status_of_database'|@translate}</h2> 199 210 200 211 <div id="dialog"></div> -
extensions/AMetaData/admin/amd_metadata_display.tpl
r5935 r5959 359 359 360 360 361 <h 3>{'g003_display_management'|@translate}</h3>361 <h2>{'g003_display_management'|@translate}</h2> 362 362 363 363 <div class="addGroup"> -
extensions/AMetaData/admin/amd_metadata_select.tpl
r5935 r5959 202 202 203 203 204 <h 3>{'g003_select_metadata'|@translate}</h3>204 <h2>{'g003_select_metadata'|@translate}</h2> 205 205 206 206 <form> -
extensions/AMetaData/amd.css
r5935 r5959 1 2 .formtable, .formtable P { text-align:left; display:block; }3 .formtable tr { vertical-align:top; }4 .littlefont { font-size:90%; }5 .littlefont td { padding:1px; }6 table.littlefont th { padding:3px; text-align:left;}7 table.littlefont td { padding:1px 3px; }8 #iprogressbar_contener { margin:0px; padding:0px; display:block; height:20px; border-width:1px; border-style:solid;}9 #iprogressbar_bg { display:block; z-index:100; position:relative; height:20px; }10 #iprogressbar_fg { width:100%; text-align:center; display: block; z-index:200; position:relative; top:-18px; }11 1 #iHeaderListTags { width:100%; border:1px solid; border-collapse: collapse; margin-top:3px; } 12 2 #iListTags { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto; position:relative; left:-1px;} … … 19 9 #iListImages.clear table tr:hover, table.clear tr:hover { color: #D54E21; background:#dbe8f3; cursor:default; } 20 10 #iHeaderListImages { width:100%; border-bottom:1px solid; } 21 .nfo ul { margin-top:0em; margin-bottom:1em; }22 .warning { color:#ffffff; background:#dd0000; margin-bottom:8px; margin-top:8px; padding:8px; }23 .warning p, .nfo p { margin-top:0.5em; margin-bottom:0em; }24 .warning ul { margin-top:0em; margin-bottom:0.5em; }25 .pctBarroma { height:6px; background:#FF7700; }26 .pctBarclear { height:6px; background:#005E89; }27 li.groupItems { border:1px solid #666666; margin-bottom:5px; padding:0 5px; width:90%; cursor:move; padding:4px; }28 11 div.addGroup { padding-left:40px; text-align:left; } 29 12 #iGroups { list-style: none; } 30 31 .ui-dialog { border-width:1px; border-style:solid; }32 .ui-dialog-buttonpane { padding:4px; }33 .ui-dialog-buttonpane button { margin-right:8px; }34 .ui-dialog-titlebar { font-weight:bold; }35 .ui-dialog-title-dialog { text-align: left; }36 .ui-dialog-titlebar-close { float: right; }37 .ui-dialog-content { overflow:auto; }38 .ui-dialog-container { }39 .ui-dialog-titlebar-close { display:none; }40 41 .ui-widget-overlay { background:#000000; opacity:0.5; filter:alpha(opacity:50); position:absolute; top:0px; left:0px; }42 13 43 14 .tagListOrder { list-style: none; padding:0px; margin-right:8px; margin-left:35px; } … … 46 17 .editGroupListButton { margin-left:8px; position:absolute; z-index:1000; } 47 18 table.tagListOrderItem { width:100%; border-collapse:collapse; } 48 .dialogForm { text-align:left; margin:8px; } 19 49 20 #ianalyzestatus { margin:8px; padding:8px; } 50 21 #ianalyzestatus ul { margin:0px; padding:0 0 0 20px; } 51 22 #iamd_nb_item_per_request_display { display:inline-block; width:70px; } 52 23 #iamd_nb_item_per_request_slider { display:inline-block; width:350px; } 53 #iDialogProgress { margin:16px 8px 8px; }54 24 #helpBody { text-align: left; padding-top:30px; } 55 25 #helpBody ul { padding:0px; margin:0px; } 56 26 #helpBody li { margin-left:30px; } 57 #iDialogProgress p { text-align: center; margin-top: 8px; margin-bottom: 0pt; }58 27 59 .tabsheet2 {60 display:table;61 font-family:verdana,arial,helvetica,sans-serif; font-size:8px;62 list-style-image:none; padding: 0 0 0 10px; position:relative; text-decoration:none;63 white-space:nowrap; margin: 0 0 0 -6px;top:-21px;border-bottom:1px solid;64 width:100%;65 }66 .tabsheet2 li { float:left; margin:0 0 0 0; overflow:hidden; text-align:right; border-width:1px; position:relative; }67 .tabsheet2 a {68 display:block; font-size:11px; border:0;69 font-weight:bold; overflow:hidden; padding:2px 6px;70 text-align:right; text-decoration:none; margin: 0; }71 .tabsheet2 a:first-letter { text-transform:capitalize; }72 73 .tabsheet2 li:hover, .tabsheet2 li.selected_tab {74 padding-top:6px; border-bottom:5px solid;75 }76 /* .tabsheet a:hover */77 .tabsheet2 a span { display:block; font-size:10px; margin-right:2px; padding:0 3px 0 1px; }78 -
extensions/AMetaData/amd_aip.class.inc.php
r5935 r5959 115 115 { 116 116 add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS')); 117 GPCCss::applyGpcCss(); 117 118 } 118 119 … … 603 604 if($result) 604 605 { 605 while($row= mysql_fetch_assoc($result))606 while($row=pwg_db_fetch_assoc($result)) 606 607 { 607 608 if($row['groupId']==-1) … … 633 634 if($result) 634 635 { 635 while($row= mysql_fetch_assoc($result))636 while($row=pwg_db_fetch_assoc($result)) 636 637 { 637 638 $datas['groups'][]=Array( … … 732 733 733 734 $data=Array( 734 'sheetContent' => $this->BBtoHTML($lang['g003_help_'.$tab]),735 'sheetContent' => GPCCore::BBtoHTML($lang['g003_help_'.$tab]), 735 736 'title' => l10n('g003_help_tab_'.$tab), 736 737 ); … … 740 741 $template->assign_var_from_handle('AMD_BODY_PAGE', 'body_page'); 741 742 } 742 743 744 745 /**746 * convert (light) BB tag to HTML tag747 *748 * all BB codes are not recognized, only :749 * - [ul] [/ul]750 * - [li] [/li]751 * - [b] [/b]752 * - [i] [/i]753 * - [url] [/url]754 * - carriage return is replaced by a <br>755 *756 * @param String $text : text to convert757 * @return String : BB to HTML text758 */759 protected function BBtoHTML($text)760 {761 $patterns = Array(762 '/\[li\](.*?)\[\/li\]\n*/im',763 '/\[b\](.*?)\[\/b\]/ism',764 '/\[i\](.*?)\[\/i\]/ism',765 '/\[url\]([\w]+?:\/\/[^ \"\n\r\t<]*?)\[\/url\]/ism',766 '/\[url=([\w]+?:\/\/[^ \"\n\r\t<]*?)\](.*?)\[\/url\]/ism',767 '/\n{0,1}\[ul\]\n{0,1}/im',768 '/\n{0,1}\[\/ul\]\n{0,1}/im',769 '/\n/im',770 );771 $replacements = Array(772 '<li>\1</li>',773 '<b>\1</b>',774 '<i>\1</i>',775 '<a href="\1">\1</a>',776 '<a href="\1">\2</a>',777 '<ul>',778 '</ul>',779 '<br>',780 );781 782 return(preg_replace($patterns, $replacements, $text));783 }784 785 786 743 787 744 … … 827 784 828 785 $sql.=" LEFT JOIN ".CADDIE_TABLE." ct ON ait.imageId = ct.element_id 829 WHERE ct.user_id = ".$user['id'].";"; 786 WHERE ct.user_id = ".$user['id']." "; 787 788 if($mode=="caddieAdd") $sql.=" AND ait.analyzed='n'"; 830 789 } 831 790 … … 841 800 { 842 801 $i=0; 843 while($row= mysql_fetch_row($result))802 while($row=pwg_db_fetch_row($result)) 844 803 { 845 804 $returned.=$row[0]; … … 876 835 $returned=""; 877 836 878 if(count($list)>0 )837 if(count($list)>0 and trim($imagesList)!='') 879 838 { 880 839 // $path = path of piwigo's on the server filesystem … … 885 844 if($result) 886 845 { 887 while($row= mysql_fetch_assoc($result))846 while($row=pwg_db_fetch_assoc($result)) 888 847 { 889 848 /* … … 938 897 if($result) 939 898 { 940 while($row= mysql_fetch_row($result))899 while($row=pwg_db_fetch_row($result)) 941 900 { 942 901 $numOfPictures=$row[0]; … … 951 910 if($result) 952 911 { 953 while($row= mysql_fetch_row($result))912 while($row=pwg_db_fetch_row($result)) 954 913 { 955 914 $numOfPicturesNotAnalyzed=$row[0]; … … 962 921 if($result) 963 922 { 964 while($row= mysql_fetch_row($result))923 while($row=pwg_db_fetch_row($result)) 965 924 { 966 925 $numOfPicturesWithoutTags=$row[0]; … … 1051 1010 if($result) 1052 1011 { 1053 while($row= mysql_fetch_assoc($result))1012 while($row=pwg_db_fetch_assoc($result)) 1054 1013 { 1055 1014 $datas[]=array( … … 1110 1069 if($result) 1111 1070 { 1112 while($row= mysql_fetch_assoc($result))1071 while($row=pwg_db_fetch_assoc($result)) 1113 1072 { 1114 1073 $datas[]=array( … … 1148 1107 if($result) 1149 1108 { 1150 if( mysql_num_rows($result)==0)1109 if(pwg_db_num_rows($result)==0) 1151 1110 { 1152 1111 $sql="INSERT INTO ".$this->tables['selected_tags']." … … 1197 1156 { 1198 1157 $datas=Array(); 1199 while($row= mysql_fetch_assoc($result))1158 while($row=pwg_db_fetch_assoc($result)) 1200 1159 { 1201 1160 if($row['groupId']==$id) … … 1298 1257 { 1299 1258 $datas=Array(); 1300 while($row= mysql_fetch_assoc($result))1259 while($row=pwg_db_fetch_assoc($result)) 1301 1260 { 1302 1261 $datas[]=Array( … … 1410 1369 $sql="INSERT INTO ".$this->tables['groups']." VALUES('', 9999)"; 1411 1370 $result=pwg_query($sql); 1412 $groupId= mysql_insert_id();1371 $groupId=pwg_db_insert_id(); 1413 1372 } 1414 1373 … … 1470 1429 if($result) 1471 1430 { 1472 while($row= mysql_fetch_assoc($result))1431 while($row=pwg_db_fetch_assoc($result)) 1473 1432 { 1474 1433 if(array_key_exists($row['lang'], $datasLang['language_list'])) … … 1519 1478 if($result) 1520 1479 { 1521 while($row= mysql_fetch_assoc($result))1480 while($row=pwg_db_fetch_assoc($result)) 1522 1481 { 1523 1482 $datas['groups'][]=Array( -
extensions/AMetaData/amd_install.class.inc.php
r5935 r5959 164 164 if($result) 165 165 { 166 while($row= mysql_fetch_assoc($result))166 while($row=pwg_db_fetch_assoc($result)) 167 167 { 168 168 $listToAnalyze[0][]=$row; … … 190 190 if($result) 191 191 { 192 while($row= mysql_fetch_assoc($result))192 while($row=pwg_db_fetch_assoc($result)) 193 193 { 194 194 $listToAnalyze[0][]=$row; -
extensions/AMetaData/amd_pip.class.inc.php
r5935 r5959 69 69 if($result) 70 70 { 71 while($row= mysql_fetch_assoc($result))71 while($row=pwg_db_fetch_assoc($result)) 72 72 { 73 73 $filename=$row['path']; … … 105 105 if($result) 106 106 { 107 while($row= mysql_fetch_assoc($result))107 while($row=pwg_db_fetch_assoc($result)) 108 108 { 109 109 $tagsList[$row['tagId']]=$row['gName']; -
extensions/AMetaData/amd_root.class.inc.php
r5935 r5959 115 115 if($result) 116 116 { 117 while($row= mysql_fetch_row($result))117 while($row=pwg_db_fetch_row($result)) 118 118 { 119 119 $numOfPictures=$row[0]; … … 141 141 $path=dirname(dirname(dirname(__FILE__))); 142 142 143 while($row= mysql_fetch_assoc($result))143 while($row=pwg_db_fetch_assoc($result)) 144 144 { 145 145 $this->analyzeImageFile($path."/".$row['path'], $row['imageId']); … … 215 215 { 216 216 $numId=-1; 217 while($row= mysql_fetch_assoc($result))217 while($row=pwg_db_fetch_assoc($result)) 218 218 { 219 219 $numId=$row['numId']; … … 268 268 if($result) 269 269 { 270 while($row= mysql_fetch_assoc($result))270 while($row=pwg_db_fetch_assoc($result)) 271 271 { 272 272 $this->config['amd_AllPicturesAreAnalyzed']=($row['nb']==0)?'y':'n'; -
extensions/AMetaData/main.inc.php
r5935 r5959 23 23 | release | date | 24 24 | 0.0 | 2010/01/21 | * start coding 25 | | | 25 26 | 0.1b | 2010/03/21 | * beta release 27 | | | 26 28 | 0.2b | 2010/03/23 | * beta release 29 | | | 27 30 | 0.3b | 2010/04/11 | * beta release 28 | 0.4b | 2010/04/18 | * beta release for Piwigo 2.129 31 | | | 30 | | | 31 | | | 32 | 0.4b | 2010/04/24 | * beta release for Piwigo 2.1 33 | | | * uses some GPC 3.1.0 functions 34 | | | * optimize ajax request to fill the metadata database 35 | | | * replace all the 'mysql_*' functions with 'pwg_db_*' 36 | | | functions 37 | | | * update some html/css 32 38 | | | 33 39 | | | -
extensions/AMetaData/maintain.inc.php
r5935 r5959 35 35 * -------------------------------------------------------------------------- */ 36 36 $gpc_installed=false; 37 $gpcNeeded="3. 0.0";37 $gpcNeeded="3.1.0"; 38 38 if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 39 39 { 40 40 @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 41 // need GPC release greater or equal than 3. 0.042 if(CommonPlugin::checkGPCRelease(3, 0,0))41 // need GPC release greater or equal than 3.1.0 42 if(CommonPlugin::checkGPCRelease(3,1,0)) 43 43 { 44 44 @include_once("amd_install.class.inc.php");
Note: See TracChangeset
for help on using the changeset viewer.