Changeset 6107
- Timestamp:
- May 7, 2010, 10:23:47 PM (14 years ago)
- Location:
- extensions/ColorStat
- Files:
-
- 2 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ColorStat/admin/cstat_config.tpl
r5961 r6107 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 4 5 {literal} 6 <style> 7 .ui-slider { 8 width:600px; 9 height:10px; 10 border-width:1px; 11 border-style:solid; 12 margin-right:5px; 13 padding-right:14px; 14 } 15 .ui-slider-handle { 16 width:12px; 17 height:12px; 18 position:relative; 19 top:-2px; 20 border-width:1px; 21 border-style:solid; 22 display:block; 23 } 24 </style> 25 <script type="text/javascript"> 26 27 28 function init() 29 { 30 formatPct({/literal}{$datas.minPct}{literal}); 31 $("#icstat_stat_minPct_slider").slider( 32 { 33 min:0.5, 34 max:60, 35 step:0.25, 36 value:{/literal}{$datas.minPct}{literal}, 37 slide: function(event, ui) { formatPct(ui.value); } 38 }); 39 $("#icstat_stat_minPct_slider a").addClass('gcBgInput'); 40 } 41 42 function formatPct(pct) 43 { 44 $("#icstat_stat_minPct").val(pct); 45 $("#icstat_stat_minPct_display").html(pct.toFixed(2)+"%"); 46 } 47 </script> 48 {/literal} 49 50 51 1 52 <h2>{'cstat_config_plugin'|@translate}</h2> 53 54 <form id="iConfig" method="post" action="" class="general"> 55 56 <fieldset> 57 <legend>{'cstat_stat_and_search'|@translate}</legend> 58 59 <table class="formtable"> 60 <tr> 61 <td colspan="2">{'cstat_percent_min_significant'|@translate}</td> 62 </tr> 63 <tr> 64 <td> 65 <input type="hidden" name="f_stat_minPct" id="icstat_stat_minPct" value="{$datas.minPct}"> 66 <div id="icstat_stat_minPct_slider" class="gcBgInput gcBorderInput"></div> 67 </td> 68 <td width="90px"> 69 <div id="icstat_stat_minPct_display"></div> 70 </td> 71 </tr> 72 </table> 73 74 </fieldset> 75 76 77 <fieldset> 78 <legend>{'cstat_gallery_integration'|@translate}</legend> 79 80 <label> 81 <input type="checkbox" id='idisplay_gallery_showColorsCBox' onclick="$('#idisplay_gallery_showColors').val(($('#idisplay_gallery_showColorsCBox').get(0).checked=='on')?'y':'n');" {if $datas.showColors=='y'}checked{/if} > 82 {'cstat_display_colors_on_image'|@translate} 83 <input type="hidden" id='idisplay_gallery_showColors' name='f_display_gallery_showColors' value='{$datas.showColors}'> 84 </label> 85 86 </fieldset> 87 88 89 90 <input type="submit" value="{'cstat_apply'|@translate}" name="submit_save_config" style="margin-left:1em;" > 91 92 </form> 93 94 95 <script type="text/javascript"> 96 init(); 97 </script> -
extensions/ColorStat/admin/cstat_database.tpl
r5961 r6107 1 1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 2 2 {known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"} 3 4 3 5 4 {literal} … … 60 59 61 60 62 doAnalyze ="<br><form id='iDialogProgress' class='formtable'>"+61 doAnalyzeDialog="<br><form id='iDialogProgress' class='formtable'>"+ 63 62 "<div id='iprogressbar_contener' class='gcBorderInput'>"+ 64 63 "<span id='iprogressbar_bg' class='gcBgInput' style='width:0%;'> </span>"+ … … 81 80 title: '{/literal}{"cstat_updating_database"|@translate}{literal} ('+modeLabel+')', 82 81 } 83 ).html(doAnalyze );82 ).html(doAnalyzeDialog); 84 83 85 84 NumberOfItemsPerRequest=$("#iNumberOfItemsPerRequest").val(); -
extensions/ColorStat/admin/cstat_install_page.tpl
r5961 r6107 1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 2 {known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.tipTip.minified.js" } 3 1 4 {literal} 2 5 <script type="text/javascript"> 3 6 var tableSize='small'; 7 8 function init() 9 { 10 $('.tiptip').tipTip( 11 { 12 'delay' : 0, 13 'fadeIn' : 0, 14 'fadeOut' : 0, 15 'edgeOffset' : 5, 16 } 17 ); 18 } 4 19 5 20 function displayTable(size) … … 52 67 <table> 53 68 <tr> 54 <td style="min-width: 450px;">{$smallTableColor}</td>69 <td style="min-width:350px;">{$smallTableColor}</td> 55 70 56 71 <td style='padding-left:30px;vertical-align:top;'> … … 85 100 <table> 86 101 <tr> 87 <td style="min-width: 450px;">{$largeTableColor}</td>102 <td style="min-width:350px;">{$largeTableColor}</td> 88 103 89 104 <td style='padding-left:30px;vertical-align:top;'> … … 121 136 </form> 122 137 138 <script type="text/javascript"> 139 init(); 140 </script> 123 141 124 -
extensions/ColorStat/admin/cstat_search.tpl
r5961 r6107 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.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"} 3 {known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.tipTip.minified.js"} 4 5 {known_script id="gpc.pagesNavigator" src=$ROOT_URL|@cat:"plugins/GrumPluginClasses/js/pagesNavigator.js"} 6 7 8 {literal} 9 <script type="text/javascript"> 10 var cb=null; 11 12 interfaceManager = function(optionsToSet) 13 { 14 var pn=null; 15 var requestNumber=0; 16 17 options = 18 { 19 requestCriterionsVisible:'', 20 requestCriterionsHidden:'', 21 requestResult:'', 22 requestResultContent:'', 23 requestResultNfo:'', 24 requestResultPagesNavigator:'', 25 requestResultRequestNumber:0, 26 onPageChange:null, 27 numberPerPage:30, 28 }; 29 30 /** 31 * 32 */ 33 this.doAction = function(fct) 34 { 35 switch(fct) 36 { 37 case 'queryResult': 38 /* function 'queryResult' : when query is executed, prepare the interface 39 */ 40 if(arguments.length==3) 41 { 42 displayQueryResult(arguments[1], arguments[2]); 43 } 44 break; 45 case 'queryPage': 46 /* function 'queryPage' : display returned page 47 */ 48 if(arguments.length==3) 49 { 50 displayQueryPage(arguments[1], arguments[2]); 51 } 52 break; 53 case 'show': 54 /* function 'show' : show/hide the query/result 55 */ 56 if(arguments.length==2) 57 { 58 show(arguments[1]); 59 } 60 break; 61 case 'setOptions': 62 /* function 'setOptions' : allows to set options after the object was 63 * created 64 */ 65 if(arguments.length==2) 66 { 67 setOptions(arguments[1]); 68 } 69 break; 70 } 71 } 72 73 /** 74 * returns the current request number 75 */ 76 this.getRequestNumber = function () 77 { 78 return(requestNumber); 79 } 80 81 /** 82 * returns the number of items per page 83 */ 84 this.getNumberPerPage = function () 85 { 86 return(options.numberPerPage); 87 } 88 89 /** 90 * this function show/hide the different panels 91 * 'buildQuery' : hide the result panel and display the panel to build query 92 * 'resultQuery' : hide the panel to build query and display the result panel 93 */ 94 var show = function(mode) 95 { 96 switch(mode) 97 { 98 case 'buildQuery': 99 $('.'+options.requestCriterionsVisible).css('display', 'block'); 100 $('.'+options.requestCriterionsHidden).css('display', 'none'); 101 $('.'+options.requestResult).css('display', 'none'); 102 break; 103 case 'resultQuery': 104 $('#iResultQueryContent').html("<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>"); 105 $('.'+options.requestCriterionsVisible).css('display', 'none'); 106 $('.'+options.requestCriterionsHidden).css('display', 'block'); 107 $('.'+options.requestResult).css('display', 'block'); 108 break; 109 } 110 } 111 112 /** 113 * this function display the number of items found and prepare the page 114 * navigator 115 * 116 * @param String nfo : 2 information separated with a semi-colon ';' 117 * requestNumber;numberOfItems 118 */ 119 var displayQueryResult = function (isSuccess, nfo) 120 { 121 if(isSuccess) 122 { 123 nfo=nfo.split(';'); 124 125 requestNumber=nfo[0]; 126 $('#iResultQueryNfo').html(nfo[1]); 127 pn.doAction('setOptions', { numberItem:nfo[1], defaultPage:1 } ); 128 show('resultQuery'); 129 } 130 else 131 { 132 //$('#'+options.requestResultContent).html(""); 133 show('buildQuery'); 134 alert('Something is wrong on the server-side !'); 135 } 136 } 137 138 139 /** 140 * this function display the number of items found and prepare the page 141 * navigator 142 * 143 * @param String nfo : 2 information separated with a semi-colon ';' 144 * requestNumber;numberOfItems 145 */ 146 var displayQueryPage = function (isSuccess, nfo) 147 { 148 if(isSuccess) 149 { 150 $('#iResultQueryContent').html(nfo); 151 } 152 else 153 { 154 alert('Something is wrong on the server-side !'); 155 } 156 } 157 158 159 /** 160 * 161 * @param Object optionsToSet : set the given options 162 */ 163 var setOptions = function(optionsToSet) 164 { 165 if(typeof optionsToSet=='object') 166 { 167 options = jQuery.extend(options, optionsToSet); 168 } 169 } 170 171 /** 172 * initialize the object 173 */ 174 var init = function (optionsToSet) 175 { 176 setOptions(optionsToSet); 177 178 pn = new pagesNavigator(options.requestResultPagesNavigator, 179 { 180 itemPerPage:options.numberPerPage, 181 displayNumPage:9, 182 classActive:'pnActive{/literal}{$datas.themeName}{literal}', 183 classInactive:'pnInactive{/literal}{$datas.themeName}{literal}', 184 onPageChange: function (page) 185 { 186 if(options.onPageChange!=null && jQuery.isFunction(options.onPageChange)) 187 { 188 options.onPageChange(requestNumber, page, options.numberPerPage); 189 } 190 }, 191 } 192 ); 193 194 requestNumber=options.requestResultRequestNumber; 195 } 196 197 init(optionsToSet); 198 } 199 200 201 function init() 202 { 203 im = new interfaceManager( 204 { 205 requestCriterionsVisible:'cRequestCriterions', 206 requestCriterionsHidden:'cModifyRequest', 207 requestResult:'cResultQuery', 208 requestResultContent:'iResultQueryContent', 209 requestResultNfo:'iResultQueryNfo', 210 requestResultPagesNavigator:'iPagesNavigator', 211 } 212 ); 213 214 requestBuilderOptions.imgEditUrl='{/literal}{$ROOT_URL}{$themeconf.admin_icon_dir}{literal}/edit_s.png'; 215 requestBuilderOptions.imgDeleteUrl='{/literal}{$ROOT_URL}{$themeconf.admin_icon_dir}{literal}/delete.png'; 216 requestBuilderOptions.classGroup='gcBorderInput gcTextInput'; 217 requestBuilderOptions.classItem='gcBgInput gcTextInput'; 218 requestBuilderOptions.classOperator='cbOperator cbOperatorBg{/literal}{$datas.themeName}{literal} gcLinkHover'; 219 requestBuilderOptions.onRequestSuccess = function (msg) { im.doAction('queryResult', true, msg); cb.doAction('getPage', im.getRequestNumber(), 1, im.getNumberPerPage()); }; 220 requestBuilderOptions.onRequestError = function (msg) { im.doAction('queryResult', false, msg); }; 221 requestBuilderOptions.onGetPageSuccess = function (msg) { im.doAction('queryPage', true, msg); }; 222 requestBuilderOptions.onGetPageError = function (msg) { im.doAction('queryPage', false, msg); }; 223 224 cb = new criteriaBuilder('iListColorsChoosen', requestBuilderOptions); 225 226 im.doAction('setOptions', 227 { onPageChange: 228 function (requestNumber, page, numberPerPage) 229 { 230 $('#iResultQueryContent').html("<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>"); 231 cb.doAction('getPage', requestNumber, page, numberPerPage); 232 } 233 } 234 ); 235 236 } 237 238 239 240 </script> 241 {/literal} 242 243 {$datas.dialogBox} 244 1 245 <h2>{'cstat_search_by_color'|@translate}</h2> 246 247 <form> 248 <fieldset> 249 <legend>{'cstat_search_criterion'|@translate}</legend> 250 251 <div id='iRequestCriterions' class='cRequestCriterions'> 252 <div style='width:100%;min-height:250px;margin-bottom:8px;'> 253 <ul id='iListColorsChoosen'> 254 </ul> 255 </div> 256 257 <div class='gcBgInput cbButtons'>{literal}<a onclick="colorBox.show({cBuilder:cb});">{/literal}{'cstat_add_colors'|@translate}</a></div> 258 <div class='gcBgInput cbButtons'>{literal}<a onclick="cb.doAction('clear');">{/literal}{'cstat_clear_colors'|@translate}</a></div> 259 </div> 260 <div class='cModifyRequest' style='display:none;'> 261 <div class='gcBgInput cbButtons'>{literal}<a onclick="im.doAction('show', 'buildQuery');">{/literal}{'cstat_do_modify_request'|@translate}</a></div> 262 </div> 263 264 </fieldset> 265 266 <input type="button" class='cRequestCriterions' style="margin-left:1em;" onclick="cb.doAction('send');" value="{'cstat_search'|@translate}"> 267 </form> 268 269 <fieldset id='iResultQuery' style='display:none;' class='cResultQuery'> 270 <legend>{'cstat_result_query'|@translate}</legend> 271 272 <div id='iResultQueryContent' style='width:100%;min-height:250px;max-height:450px;overflow:auto;margin-bottom:8px;'></div> 273 274 <div class='gcBgInput gcTextInput'> 275 <div id='iPagesNavigator' style='float:right;'></div> 276 <div style='text-align:left;padding:4px;'>{'cstat_number_of_item_found'|@translate} : <span id='iResultQueryNfo'></span></div> 277 </div> 278 279 </fieldset> 280 281 282 <script type="text/javascript"> 283 init(); 284 </script> -
extensions/ColorStat/admin/cstat_stat.tpl
r5961 r6107 1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 2 {known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.tipTip.minified.js" } 1 3 2 4 {literal} … … 7 9 loadColorList(); 8 10 displayColorListOrder(); 11 $('.tiptip').tipTip( 12 { 13 'delay' : 0, 14 'fadeIn' : 0, 15 'fadeOut' : 0, 16 'edgeOffset' : 5, 17 } 18 ); 9 19 } 10 20 … … 87 97 <th style="min-width:180px;" colspan="2"><span id="iHLTOrderColor"></span><a onclick="sortColorList('color');">{'cstat_colors'|@translate}</a></th> 88 98 89 <th width="60px"><span id="iHLTOrderNumImages"></span><a onclick="sortColorList('img');" title="{'cstat_NumOfImages_help'|@translate}">{'cstat_NumOfImages'|@translate}</a></th>99 <th width="60px"><span id="iHLTOrderNumImages"></span><a class="tiptip" onclick="sortColorList('img');" title="{'cstat_NumOfImages_help'|@translate}">{'cstat_NumOfImages'|@translate}</a></th> 90 100 <th width="40px">{'cstat_Pct'|@translate}</th> 91 101 <th width="115px"> </th> 92 102 93 <th width="80px"><span id="iHLTOrderNumPixels"></span><a onclick="sortColorList('pixels');" title="{'cstat_NumOfPixels_help'|@translate}">{'cstat_NumOfPixels'|@translate}</a></th>103 <th width="80px"><span id="iHLTOrderNumPixels"></span><a class="tiptip" onclick="sortColorList('pixels');" title="{'cstat_NumOfPixels_help'|@translate}">{'cstat_NumOfPixels'|@translate}</a></th> 94 104 <th width="40px">{'cstat_Pct'|@translate}</th> 95 105 <th width="130px"> </th> -
extensions/ColorStat/cstat.css
r5961 r6107 32 32 font-size:130%; 33 33 } 34 35 .cellColorChoose { 36 width:15px; 37 height:15px; 38 margin:2px; 39 float:left; 40 cursor:pointer; 41 } 42 43 44 #iListColorsChoosen { padding:0px; } 45 46 #iListColorsChoosen ul li, #dragHelper ul li { 47 clear:both; 48 min-height:32px; 49 list-style-image:none; 50 list-style-position:outside; 51 list-style-type:none; 52 margin:4px; 53 padding:0px; 54 } 55 56 #iListColorsChoosen ul { padding:0px; } 57 58 59 .cbGroup { border-width:1px; border-style:solid; padding:0px; margin:2px; min-height:30px; list-style:none; } 60 .cbItem { padding:2px; margin:8px; min-height:34px; list-style:none; } 61 62 #iListColorsChoosen ul li.cbItem, #dragHelper ul li.cbItem { padding:2px; } 63 64 .cbItemButtons { padding:2px; } 65 .cbItem img { cursor: pointer; } 66 67 .cbSortHandle { cursor:move; } 68 69 div.cbOperator { 70 cursor:pointer; 71 padding:4px; 72 text-align:left; 73 font-weight:bold; 74 } 75 76 div.cbOperatorBgroma { 77 background:#333333; 78 } 79 80 div.cbOperatorBgclear { 81 background:#dbe8f3; 82 } 83 84 .cbButtons { 85 float:left; 86 margin:2px; 87 padding:8px; 88 } 89 90 .helper { 91 border:2px dashed #777777; 92 } 93 94 .cPnActive, .cPnDisabled, .cPnInactive { margin:2px; padding:2px; min-width:20px; text-align:center; } 95 .pnInactiveclear, .pnInactiveroma { cursor:pointer; } 96 .pnInactiveclear:hover { background:#F1F1F1; } 97 .pnActiveclear { background:#F1F1F1; font-weight:bold; } 98 .pnInactiveroma:hover { background:#999999; color:#444444; } 99 .pnActiveroma { background:#999999; color:#444444; font-weight:bold; } 100 #iPagesNavigator ul { margin:0px; } 101 102 .color1px { border-spacing:1px; } 103 .color0px { border-spacing:0px; } 104 -
extensions/ColorStat/cstat_aip.class.inc.php
r5961 r6107 1 1 <?php 2 2 /* ----------------------------------------------------------------------------- 3 Plugin : LMT3 Plugin : ColorStat 4 4 Author : Grum 5 5 email : grum@piwigo.org … … 10 10 See main.inc.php for release information 11 11 12 LMT_AIP : classe to manage plugin admin pages12 CStat_AIP : classe to manage plugin admin pages 13 13 14 14 --------------------------------------------------------------------------- */ 15 16 if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 15 17 16 18 include_once('cstat_root.class.inc.php'); 17 19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 20 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTabSheet.class.inc.php'); 21 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php'); 18 22 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 19 23 … … 25 29 { 26 30 parent::__construct($prefixeTable, $filelocation); 31 $this->checkRequest(); 32 27 33 $this->loadConfig(); 28 34 $this->initEvents(); … … 55 61 { 56 62 parent::initEvents(); 63 if($_REQUEST['f_tabsheet']=='search') 64 { 65 // load request builder JS only on the search page 66 GPCRequestBuilder::loadJSandCSS(); 67 } 57 68 add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS')); 58 69 GPCCss::applyGpcCss(); … … 65 76 { 66 77 global $template; 67 68 $this->checkRequest();69 78 70 79 $this->returnAjaxContent(); … … 154 163 { 155 164 if(!isset($_REQUEST['selectMode'])) $_REQUEST['selectMode']='caddieAdd'; 156 if(!isset($_REQUEST['numOfItems'])) $_REQUEST['numOfItems']=$this->config['analyze .itemPerRequest'];165 if(!isset($_REQUEST['numOfItems'])) $_REQUEST['numOfItems']=$this->config['analyze_itemPerRequest']; 157 166 158 167 if(!($_REQUEST['selectMode']=='notAnalyzed' or … … 181 190 } 182 191 192 183 193 } 184 194 … … 195 205 $datas=Array( 196 206 'urlRequest' => $this->getAdminLink(), 197 'numberOfItemsPerRequest' => $this->config['analyze .itemPerRequest']207 'numberOfItemsPerRequest' => $this->config['analyze_itemPerRequest'] 198 208 ); 199 209 $template->assign('datas', $datas); … … 211 221 dirname($this->getFileLocation()).'/admin/cstat_stat.tpl'); 212 222 213 $generalStats=$this->getGeneralStats(); 214 215 $colors=Array(); 216 $sql="SELECT color_id, num_images, num_pixels 217 FROM ".$this->tables['color_table']." 218 WHERE num_images > 0 219 ORDER BY color_id "; 220 $result=pwg_query($sql); 221 if($result) 222 { 223 while($row=pwg_db_fetch_assoc($result)) 224 { 225 $colors[$row['color_id']]=Array('num_images' => $row['num_images'], 'num_pixels' => $row['num_pixels']); 226 } 227 } 228 229 $colorTable=ColorStat::getColorTable( 230 $this->colorTableSize[$this->config['analyze.colorTable']][0], 231 $this->colorTableSize[$this->config['analyze.colorTable']][1] 232 ); 233 foreach($colorTable as $key=>$val) 234 { 235 foreach($val as $key2=>$val2) 236 { 237 $rgb=$val2->getRGB()->getHexString(); 238 $colorTable[$key][$key2]=Array( 239 'color' => $rgb, 240 'pct' => (array_key_exists($rgb, $colors))?sprintf("%.2f", round(100*$colors[$rgb]['num_pixels']/$generalStats['pixelsAnalyzedSum'],2)):"", 241 'num' => (array_key_exists($rgb, $colors))?$colors[$rgb]['num_images']:"", 242 ); 243 } 244 } 223 $colorTable=$this->getColorTableWithStat(); 224 245 225 246 226 $datas=Array( 227 //'themeconf' => Array('name' => $template->get_themeconf('name')), 247 228 'colorTable' => $this->htmlColorTable( 248 229 $colorTable, 249 ($this->config['analyze.colorTable']=='small')?19:10 230 ($this->config['analyze_colorTable']=='small')?19:10, 231 "", 232 "color0px" 250 233 ), 251 234 'urlRequest' => $this->getAdminLink(), 252 'config_GetListColors_OrderType' => $this->config['display .stat.orderType'],235 'config_GetListColors_OrderType' => $this->config['display_stat_orderType'], 253 236 ); 254 237 $template->assign('datas', $datas); … … 267 250 dirname($this->getFileLocation()).'/admin/cstat_search.tpl'); 268 251 252 $datas=Array( 253 'dialogBox' => $this->dialogBoxColor(), 254 'themeName' => $template->get_themeconf('name'), 255 ); 256 257 $template->assign('datas', $datas); 258 269 259 $template->assign_var_from_handle('CSTAT_BODY_PAGE', 'body_page'); 270 260 } //displaySearchPage … … 276 266 protected function displayConfigPage() 277 267 { 278 /* 268 $tmpPct=$this->config['stat_minPct']; 269 279 270 if(!$this->adviser_abort()) 280 271 { … … 283 274 foreach($this->config as $key => $val) 284 275 { 285 if(is _array($val))276 if(isset($_REQUEST['f_'.$key])) 286 277 { 287 foreach($languages as $key2 => $val2) 288 { 289 if(isset($_REQUEST[str2url('f_'.$key.'_'.$key2)])) 290 { 291 $this->config[$key][$key2] = htmlspecialchars(stripslashes($_REQUEST[str2url('f_'.$key.'_'.$key2)]), ENT_QUOTES); 292 } 293 } 278 $this->config[$key] = $_REQUEST['f_'.$key]; 294 279 } 295 else296 {297 if(isset($_REQUEST['f_'.$key]))298 {299 $this->config[$key] = $_REQUEST['f_'.$key];300 }301 }302 303 280 } 304 $this->displayResult(l10n('lmt_save_config'), $this->saveConfig()); 305 } 306 }*/ 281 $this->displayResult(l10n('cstat_save_config'), $this->saveConfig()); 282 } 283 } 284 285 if($tmpPct!=$this->config['stat_minPct']) 286 { 287 $this->updateDatabaseConsolidation(); 288 } 289 307 290 $this->displayConfig(); 308 291 } … … 317 300 $template->set_filename('body_page', 318 301 dirname($this->getFileLocation()).'/admin/cstat_config.tpl'); 302 303 $datas=Array( 304 'minPct' => $this->config['stat_minPct'], 305 'showColors' => $this->config['display_gallery_showColors'] 306 ); 307 308 $template->assign('datas', $datas); 319 309 320 310 $template->assign_var_from_handle('CSTAT_BODY_PAGE', 'body_page'); … … 353 343 'quality' => 8, 354 344 'numColors' => 16, 355 'maxTime' => $this->config['analyze .maxTime'],356 'pps' => $this->config['analyze .pps'],345 'maxTime' => $this->config['analyze_maxTime'], 346 'pps' => $this->config['analyze_pps'], 357 347 ) 358 348 ); … … 443 433 } 444 434 435 436 /** 437 * make consolidation for the color_table : 438 * - count number of images using a color 439 * - count number of pixels of a color 440 */ 441 protected function updateDatabaseConsolidation() 442 { 443 $sql="UPDATE ".$this->tables['color_table']." cct 444 SET cct.num_images=0, 445 cct.num_pixels=0;"; 446 pwg_query($sql); 447 448 $sql="UPDATE ".$this->tables['color_table']." cct, 449 (SELECT color_id, 450 count(image_id) AS num_images, 451 sum(num_pixels) AS num_pixels 452 FROM ".$this->tables['images_colors']." 453 WHERE pct >= ".$this->config['stat_minPct']." 454 GROUP BY color_id) cic 455 SET cct.num_images=cic.num_images, 456 cct.num_pixels=cic.num_pixels 457 WHERE cct.color_id=cic.color_id;"; 458 pwg_query($sql); 459 460 $sql="UPDATE ".$this->tables['images']." pci 461 SET pci.colors = '', 462 pci.colors_pct = ''"; 463 pwg_query($sql); 464 465 $sql="UPDATE ".$this->tables['images']." pci, 466 (SELECT image_id, 467 GROUP_CONCAT(color_id ORDER BY pct DESC SEPARATOR ',') AS colors, 468 GROUP_CONCAT(pct ORDER BY pct DESC SEPARATOR ',') AS colors_pct 469 FROM ".$this->tables['images_colors']." 470 WHERE pct >= ".$this->config['stat_minPct']." 471 GROUP BY image_id) pcic 472 SET pci.colors = pcic.colors, 473 pci.colors_pct = pcic.colors_pct 474 WHERE pci.image_id = pcic.image_id;"; 475 pwg_query($sql); 476 } 477 445 478 /* --------------------------------------------------------------------------- 446 479 ajax functions … … 593 626 { 594 627 $colorTable=ColorStat::getColorTable( 595 $this->colorTableSize[$this->config['analyze .colorTable']][0],596 $this->colorTableSize[$this->config['analyze .colorTable']][1]628 $this->colorTableSize[$this->config['analyze_colorTable']][0], 629 $this->colorTableSize[$this->config['analyze_colorTable']][1] 597 630 ); 598 631 … … 629 662 private function ajax_cstat_updateDatabaseConsolidation() 630 663 { 631 $sql="UPDATE ".$this->tables['color_table']." cct, 632 (SELECT color_id, 633 count(image_id) AS num_images, 634 sum(num_pixels) AS num_pixels 635 FROM ".$this->tables['images_colors']." 636 GROUP BY color_id) cic 637 SET cct.num_images=cic.num_images, 638 cct.num_pixels=cic.num_pixels 639 WHERE cct.color_id=cic.color_id;"; 640 pwg_query($sql); 664 $this->updateDatabaseConsolidation(); 641 665 return("ok"); 642 666 } … … 657 681 global $template; 658 682 659 $this->config['display .stat.orderType'] = $orderType;683 $this->config['display_stat_orderType'] = $orderType; 660 684 $this->saveConfig(); 661 685 -
extensions/ColorStat/cstat_aip_install.class.inc.php
r5961 r6107 10 10 See main.inc.php for release information 11 11 12 LMT_AIP : classe to manage plugin admin pages13 14 12 --------------------------------------------------------------------------- */ 13 14 if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 15 15 16 16 include_once('cstat_root.class.inc.php'); … … 128 128 $smallColorTable=ColorStat::getColorTable($this->colorTableSize['small'][0],$this->colorTableSize['small'][1]); 129 129 $largeColorTable=ColorStat::getColorTable($this->colorTableSize['large'][0],$this->colorTableSize['large'][1]); 130 $template->assign('smallTableColor', $this->htmlColorTable($smallColorTable, 19 ));131 $template->assign('largeTableColor', $this->htmlColorTable($largeColorTable, 10 ));130 $template->assign('smallTableColor', $this->htmlColorTable($smallColorTable, 19, '', 'color0px')); 131 $template->assign('largeTableColor', $this->htmlColorTable($largeColorTable, 10, '', 'color0px')); 132 132 133 133 $template->assign( … … 135 135 $this->htmlColorList( 136 136 ColorStat::getFileColors(dirname($this->getFileLocation()).'/image/sample1.png', $smallColorTable, Array('quality' => 8, 'numColors' => 16)), 137 16, 18, '', 'colorListSample '137 16, 18, '', 'colorListSample color0px' 138 138 ) 139 139 ); … … 144 144 $this->htmlColorList( 145 145 ColorStat::getFileColors(dirname($this->getFileLocation()).'/image/sample1.png', $largeColorTable, Array('quality' => 8, 'numColors' => 16)), 146 16, 18, '', 'colorListSample '146 16, 18, '', 'colorListSample color0px' 147 147 ) 148 148 ); … … 153 153 $this->htmlColorList( 154 154 ColorStat::getFileColors(dirname($this->getFileLocation()).'/image/sample2.png', $smallColorTable, Array('quality' => 8, 'numColors' => 16)), 155 16, 18, '', 'colorListSample '155 16, 18, '', 'colorListSample color0px' 156 156 ) 157 157 ); … … 162 162 $this->htmlColorList( 163 163 ColorStat::getFileColors(dirname($this->getFileLocation()).'/image/sample2.png', $largeColorTable, Array('quality' => 8, 'numColors' => 16)), 164 16, 18, '', 'colorListSample '164 16, 18, '', 'colorListSample color0px' 165 165 ) 166 166 ); … … 170 170 unset($largeColorTable); 171 171 172 $this->config['analyze .pps']=round($pps/4,0);172 $this->config['analyze_pps']=round($pps/4,0); 173 173 $this->saveConfig(); 174 174 … … 202 202 { 203 203 $this->config['newInstall']='n'; 204 $this->config['analyze .colorTable']=$tableSize;204 $this->config['analyze_colorTable']=$tableSize; 205 205 $this->saveConfig(); 206 206 -
extensions/ColorStat/cstat_colorstat.class.inc.php
r5961 r6107 45 45 46 46 --------------------------------------------------------------------------- */ 47 48 if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 47 49 48 50 /** -
extensions/ColorStat/cstat_install.class.inc.php
r5961 r6107 14 14 --------------------------------------------------------------------------- */ 15 15 16 include_once('cstat_version.inc.php'); // => Don't forget to update this file !! 17 include_once('cstat_root.class.inc.php'); 18 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 16 if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 17 18 include_once('cstat_version.inc.php'); // => Don't forget to update this file !! 19 include_once('cstat_root.class.inc.php'); 20 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 21 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php'); 19 22 20 23 /* CStat class for install process */ … … 79 82 `time` float unsigned NOT NULL default '0', 80 83 `quality` tinyint(4) NOT NULL default '0', 84 `colors` char(111) NOT NULL default '', 85 `colors_pct` char(111) NOT NULL default '', 81 86 PRIMARY KEY (`image_id`), 82 87 KEY `by_analyzed` (`analyzed`) 83 88 )", 84 85 89 ); 86 90 … … 121 125 quality=0;"); 122 126 pwg_query("INSERT INTO ".$this->tables['images']." 123 SELECT id, 'n', 0, 0, 0, 0, 0, 0 127 SELECT id, 'n', 0, 0, 0, 0, 0, 0, '' 124 128 FROM ".IMAGES_TABLE." 125 129 WHERE id NOT IN (SELECT image_id FROM ".$this->tables['images'].")"); -
extensions/ColorStat/cstat_pip.class.inc.php
r5961 r6107 1 1 <?php 2 2 /* ----------------------------------------------------------------------------- 3 Plugin : LMT3 Plugin : ColorStat 4 4 Author : Grum 5 5 email : grum@piwigo.org … … 10 10 See main.inc.php for release information 11 11 12 LMT_PIP : classe to manage plugin public pages12 CStat_PIP : classe to manage plugin public pages 13 13 14 14 --------------------------------------------------------------------------- */ 15 15 16 include_once(' lmt_root.class.inc.php');16 include_once('cstat_root.class.inc.php'); 17 17 //include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCPublicIntegration.class.inc.php'); 18 18 19 class LMT_PIP extends LMT_root19 class CStat_PIP extends CStat_root 20 20 { 21 21 protected $section_page; … … 36 36 } 37 37 38 /* 39 load language file40 */38 /** 39 * load language file 40 */ 41 41 public function load_lang() 42 42 { 43 43 global $lang; 44 44 45 load_language('plugin.lang', LMT_PATH); 46 47 // ajax is managed here ; this permit to use user&language properties inside 48 // ajax content 49 //$this->return_ajax_content(); 45 load_language('plugin.lang', CSTAT_PATH); 50 46 } 51 47 52 /* 53 initialize events call for the plugin54 */48 /** 49 * initialize events call for the plugin 50 */ 55 51 public function initEvents() 56 52 { 57 53 parent::initEvents(); 58 /* 59 add_event_handler('blockmanager_apply', array(&$this, 'blockmanager_apply') ); 60 add_event_handler('loading_lang', array(&$this, 'load_lang')); 61 */ 62 if($this->config['lmt_licence_activated']=='y') 54 55 if($this->config['display_gallery_showColors']=='y') 63 56 { 64 add_event_handler('loc_end_page_header', array(&$this->css_icn, 'applyCSS')); 65 add_event_handler('loc_end_picture', array(&$this, 'manage_licence_element')); 66 67 if($this->config['lmt_warning_visible']=='y') 68 { 69 add_event_handler('loc_end_page_tail', array(&$this, 'manage_warning_text')); 70 } 57 add_event_handler('loc_begin_picture', array(&$this, 'addColors')); 71 58 } 72 59 } … … 75 62 76 63 /* ------------------------------------------------------------------------- 77 FUNCTIONS TO MANAGE LMTDISPLAY64 FUNCTIONS TO MANAGE COLORS DISPLAY 78 65 ------------------------------------------------------------------------- */ 79 public function manage_licence_element()66 public function addColors() 80 67 { 81 global $ template, $page, $user;68 global $page, $template; 82 69 83 $licence=$this->get_image_licence($page['image_id']); 84 if($licence['licence']=="") 70 $colors=$this->getImageColors($page['image_id']); 71 72 73 if(count($colors['colors'])>0) 85 74 { 86 return(""); 75 $metadata=$template->get_template_vars('metadata'); 76 77 $tmp=Array(); 78 79 for($i=0;$i<count($colors['colors']);$i++) 80 { 81 $tmp[$colors['colors'][$i]]['pct']=$colors['colors_pct'][$i]; 82 } 83 84 $colorsNfo=Array( 85 'TITLE' => l10n('cstat_colors'), 86 'lines' => Array( 87 l10n('cstat_colors_on_image') => $this->htmlColorList($tmp, 8, 25, "", "color1px", "/"), 88 ) 89 ); 90 91 $metadata[]=$colorsNfo; 92 93 $template->assign('metadata', $metadata); 87 94 } 88 89 if($this->config['lmt_redirect_activated']=='y')90 {91 $url=$this->config['lmt_redirect_url-'.strToLower($licence['licence'])][$user['language']];92 if($url=='')93 {94 $url=$this->config['lmt_redirect_url-'.strToLower($licence['licence'])]['en_UK'];95 }96 }97 else98 {99 $url="";100 }101 102 $style="";103 $text="";104 $target=($this->config['lmt_redirect_open_target']=="y")?" onclick='window.open(this.href); return false;'":"";105 switch($this->config['lmt_licence_logo'])106 {107 case '80x15':108 if($url!="")109 {110 $text = "<br/><a href='".$url."'".$target."><img class='logo80x15' src='". LMT_PATH."img/".strToLower($licence['licence'])."_80x15.png'></a>".$licence['aut_text1']." ".$licence['aut_text2'];111 }112 else113 {114 $text = "<br/><img class='logo80x15' src='". LMT_PATH."img/".strToLower($licence['licence'])."_80x15.png'>".$licence['aut_text1']." ".$licence['aut_text2'];115 }116 break;117 case '88x31';118 $style=" style='text-align:left;'";119 if($url!="")120 {121 $text = "<table style='margin:auto;'><tr><td><a href='".$url."'".$target."><img class='logo88x31' style='top:-4px;' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></a></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";122 }123 else124 {125 $text = "<table style='margin:auto;'><tr><td><img class='logo88x31' style='top:-4px;' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";126 }127 break;128 case 'text';129 if($url!="")130 {131 $text ="<br/>".l10n("lmt_lbl_under-".strToLower($licence['licence']))." <a href='".$url."'".$target.">".l10n("lmt_lbl_cc_s-".strToLower($licence['licence']))."</a> ".$licence['aut_text1']." ".$licence['aut_text2'];132 }133 else134 {135 $text ="<br/>".l10n("lmt_lbl_under-".strToLower($licence['licence']))." ".l10n("lmt_lbl_cc_s-".strToLower($licence['licence']))." ".$licence['aut_text1']." ".$licence['aut_text2'];136 }137 break;138 }139 140 $template->concat('COMMENT_IMG', '<span class="licencetag" '.$style.'>'.$text.'</span>');141 95 } 142 96 143 public function manage_warning_text()144 {145 global $template, $user;146 147 148 if(isset($this->config['lmt_warning_texts'][$user['language']]))149 {150 $text=$this->config['lmt_warning_texts'][$user['language']];151 }152 else153 {154 $text=$this->config['lmt_warning_texts']['en_UK'];155 }156 157 $patterns = array('/\[logo=80x15\]/i', '/\[logo=88x31\]/i', '/\[logo=text\]/i');158 $replacements = array(159 "<img class='logo80x15' src='". LMT_PATH."img/".strToLower($this->config['lmt_licence_default'])."_80x15.png'>",160 "<img class='logo88x31' src='". LMT_PATH."img/".strToLower($this->config['lmt_licence_default'])."_88x31.png'>",161 l10n("lmt_lbl_cc_s-".strToLower($this->config['lmt_licence_default']))162 );163 164 if($this->config['lmt_redirect_activated']=='y')165 {166 $url=$this->config['lmt_redirect_url-'.strToLower($this->config['lmt_licence_default'])][$user['language']];167 if($url=='')168 {169 $url=$this->config['lmt_redirect_url-'.strToLower($this->config['lmt_licence_default'])]['en_UK'];170 }171 if($url!="")172 {173 $target=($this->config['lmt_redirect_open_target']=="y")?" onclick='window.open(this.href); return false;'":"";174 $replacements[0]="<a href='".$url."'".$target.">".$replacements[0]."</a>";175 $replacements[1]="<a href='".$url."'".$target.">".$replacements[1]."</a>";176 $replacements[2]="<a href='".$url."'".$target.">".$replacements[2]."</a>";177 }178 }179 180 $text = preg_replace($patterns, $replacements, $text);181 182 $template->append("footer_elements", "<span>".htmlspecialchars_decode($text)."</span>");183 }184 97 185 98 -
extensions/ColorStat/cstat_root.class.inc.php
r5961 r6107 13 13 14 14 --------------------------------------------------------------------------- */ 15 16 if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 17 18 15 19 include_once('cstat_colorstat.class.inc.php'); 16 20 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); … … 63 67 $this->config=array( 64 68 'newInstall' => 'n', 65 'analyze.maxTime' => 0.1, 66 'analyze.colorTable' => 'small', 67 'analyze.pps' => 0, 68 'analyze.itemPerRequest' => 10, 69 'display.stat.orderType' => 'img', 69 'analyze_maxTime' => 0.1, 70 'analyze_colorTable' => 'small', 71 'analyze_pps' => 0, 72 'analyze_itemPerRequest' => 10, 73 'display_gallery_showColors' => 'n', 74 'display_stat_orderType' => 'img', 75 'stat_minPct' => 3.5, 70 76 ); 71 77 } … … 137 143 * @return String : HTML code 138 144 */ 139 public function htmlColorList($colorList, $split=8, $size=5, $id="", $class="" )145 public function htmlColorList($colorList, $split=8, $size=5, $id="", $class="", $br='<br>') 140 146 { 141 147 global $template; … … 163 169 'size' => $size, 164 170 'id' => $id, 165 'class' => $class 171 'class' => $class, 172 'br' => $br, 166 173 ); 167 174 … … 172 179 } 173 180 174 175 176 177 protected function displayResult($action_msg, $result) 178 { 179 global $page; 180 181 /** 182 * returns an array of colors & colors percent of an image 183 * 184 * @param Integer $imageId : id of the image 185 * @return Array('colors' => Array(), 'colors_pct' => Array()) 186 */ 187 public function getImageColors($imageId) 188 { 189 $returned=Array( 190 'colors' => Array(), 191 'colors_pct' => Array(), 192 ); 193 194 $sql="SELECT colors, colors_pct 195 FROM ".$this->tables['images']." 196 WHERE image_id='".$imageId."'"; 197 $result=pwg_query($sql); 181 198 if($result) 182 199 { 183 array_push($page['infos'], $action_msg); 184 } 185 else 186 { 187 array_push($page['errors'], $action_msg); 188 } 189 } 200 while($row=pwg_db_fetch_assoc($result)) 201 { 202 $returned['colors']=explode(',', $row['colors']); 203 $returned['colors_pct']=explode(',', $row['colors_pct']); 204 } 205 } 206 return($returned); 207 } 208 209 210 211 /** 212 * return all HTML&JS code necessary to display a dialogbox to choose 213 * colors 214 */ 215 protected function dialogBoxColor() 216 { 217 global $template; 218 219 $template->set_filename('colors_choose', 220 dirname($this->getFileLocation()).'/templates/cstat_dialog_colors_choose.tpl'); 221 222 $colorTable=$this->getColorTableWithStat(); 223 224 $datas=Array( 225 'colorTable' => $this->htmlColorTable( 226 $colorTable, 227 ($this->config['analyze_colorTable']=='small')?16:8, 228 "", 229 "color0px" 230 ), 231 //'urlRequest' => $this->getAdminLink(), 232 ); 233 234 $template->assign('datas', $datas); 235 unset($data); 236 237 return($template->parse('colors_choose', true)); 238 } 239 240 241 /** 242 * return a color table with stat on color 243 * 244 * @return Array : a color table with statistics on colors 245 */ 246 protected function getColorTableWithStat() 247 { 248 $generalStats=$this->getGeneralStats(); 249 250 $colors=Array(); 251 $sql="SELECT color_id, num_images, num_pixels 252 FROM ".$this->tables['color_table']." 253 WHERE num_images > 0 254 ORDER BY color_id "; 255 $result=pwg_query($sql); 256 if($result) 257 { 258 while($row=pwg_db_fetch_assoc($result)) 259 { 260 $colors[$row['color_id']]=Array('num_images' => $row['num_images'], 'num_pixels' => $row['num_pixels']); 261 } 262 } 263 264 $colorTable=ColorStat::getColorTable( 265 $this->colorTableSize[$this->config['analyze_colorTable']][0], 266 $this->colorTableSize[$this->config['analyze_colorTable']][1] 267 ); 268 foreach($colorTable as $key=>$val) 269 { 270 foreach($val as $key2=>$val2) 271 { 272 $rgb=$val2->getRGB()->getHexString(); 273 $colorTable[$key][$key2]=Array( 274 'color' => $rgb, 275 'pct' => '', //(array_key_exists($rgb, $colors))?sprintf("%.2f", round(100*$colors[$rgb]['num_pixels']/$generalStats['pixelsAnalyzedSum'],2)):"", 276 'num' => (array_key_exists($rgb, $colors))?$colors[$rgb]['num_images']:"", 277 ); 278 } 279 } 280 281 unset($colors); 282 return($colorTable); 283 } 284 285 286 190 287 191 288 -
extensions/ColorStat/language/en_UK/plugin.lang.php
r5961 r6107 59 59 $lang['cstat_NumOfImages']='Number of images'; 60 60 $lang['cstat_NumOfPixels']='Number of pixels'; 61 $lang['cstat_NumOfImages_help']="Indicates the number of images in which color is present. 62 $lang['cstat_NumOfPixels_help']="Indicates the number of pixels for which color has been determined. 61 $lang['cstat_NumOfImages_help']="Indicates the number of images in which color is present.<br>The percentage is relative to the number of images analyzed."; 62 $lang['cstat_NumOfPixels_help']="Indicates the number of pixels for which color has been determined.<br>The percentage is relative to the number of pixels analyzed and represents the 'area' occupied on all photos."; 63 63 $lang['cstat_images']='images'; 64 64 $lang['cstat_surface']='surface'; 65 65 66 66 67 67 68 $lang['cstat_search']='Search'; 69 $lang['cstat_search_by_color']='Search by color'; 70 $lang['cstat_choose_colors']='Sélection de couleurs'; 71 $lang['cstat_choosen_colors']='Couleurs sélectionnées'; 72 $lang['cstat_operator_and']="Toutes les couleurs sélectionnées doivent être présentes dans l'image"; 73 $lang['cstat_operator_or']="Au moins une des couleurs sélectionnées doit être présente dans l'image"; 74 $lang['cstat_operator_not']="Aucune des couleurs sélectionnées ne doit être présente dans l'image'"; 75 $lang['cstat_color_already_choosen']='La couleur est déjà sélectionnée dans la liste'; 76 $lang['cstat_add_colors']='Ajouter une sélection de couleurs'; 77 $lang['cstat_clear_colors']='Réinitialiser les critères'; 78 $lang['cstat_do_modify_request']='Modifier la recherche'; 79 $lang['cstat_search_criterion'] = 'Critères de recherche'; 80 81 68 82 $lang['cstat_config']='Configuration'; 69 83 70 $lang['cstat_search_by_color']='Search by color';71 84 $lang['cstat_config_plugin']='Configuring the plugin'; 72 85 -
extensions/ColorStat/language/fr_FR/plugin.lang.php
r5961 r6107 9 9 $lang['cstat_release'] = 'v'; 10 10 $lang['cstat_ok']='OK'; 11 $lang['cstat_cancel']='Annuler'; 11 12 12 13 $lang['cstat_install'] = 'Installation'; … … 63 64 $lang['cstat_NumOfImages']='Nombre d\'images'; 64 65 $lang['cstat_NumOfPixels']='Nombre de pixels'; 65 $lang['cstat_NumOfImages_help']="Indique le nombre d'images dans lesquelles la couleur est présente. 66 $lang['cstat_NumOfPixels_help']="Indique le nombre de pixels pour lesquels la couleur a été déterminée. 66 $lang['cstat_NumOfImages_help']="Indique le nombre d'images dans lesquelles la couleur est présente.<br>Le pourcentage est relatif au nombre d'images analysées."; 67 $lang['cstat_NumOfPixels_help']="Indique le nombre de pixels pour lesquels la couleur a été déterminée.<br>Le pourcentage est relatif au nombre de pixels analysés et représente la 'surface' occupée sur l'ensemble des photos."; 67 68 $lang['cstat_images']='images'; 68 69 $lang['cstat_surface']='surface'; … … 70 71 71 72 $lang['cstat_search']='Recherche'; 73 $lang['cstat_search_by_color']='Effectuer une recherche par couleur'; 74 $lang['cstat_choose_colors']='Sélection de couleurs'; 75 $lang['cstat_choosen_colors']='Couleurs sélectionnées'; 76 $lang['cstat_operator_and']="Toutes les couleurs sélectionnées doivent être présentes dans l'image"; 77 $lang['cstat_operator_or']="Au moins une des couleurs sélectionnées doit être présente dans l'image"; 78 $lang['cstat_operator_not']="Aucune des couleurs sélectionnées ne doit être présente dans l'image'"; 79 $lang['cstat_color_already_choosen']='La couleur est déjà sélectionnée dans la liste'; 80 $lang['cstat_add_colors']='Ajouter une sélection de couleurs'; 81 $lang['cstat_clear_colors']='Réinitialiser les critères'; 82 $lang['cstat_do_modify_request']='Modifier la recherche'; 83 $lang['cstat_search_criterion'] = 'Critères de recherche'; 84 $lang['cstat_number_of_item_found']='Nombre d\'images trouvées'; 85 $lang['cstat_result_query']='Résultat de la recherche'; 86 72 87 $lang['cstat_config']='Configuration'; 88 $lang['cstat_gallery_integration']='Intégration dans la galerie'; 89 $lang['cstat_apply']='Appliquer'; 90 $lang['cstat_stat_and_search']='Statistiques & Recherches'; 91 $lang['cstat_save_config']='Configuration enregistrée'; 92 $lang['cstat_display_colors_on_image']='Afficher les couleurs associées à l\'image'; 93 $lang['cstat_percent_min_significant']='Présence minimum au sein d\'une image pour qu\'une couleur soit considérée comme pertinente lors d\'une recherche :'; 73 94 74 $lang['cstat_search_by_color']='Effectuer une recherche par couleur';75 95 $lang['cstat_config_plugin']='Configuration du plugin'; 76 96 97 $lang['cstat_colors_on_image']='Couleurs associées à l\'image'; 98 77 99 ?> -
extensions/ColorStat/main.inc.php
r5961 r6107 85 85 { 86 86 //CStat public interface loaded and active only if in public page 87 /*include_once("cstat_pip.class.inc.php");87 include_once("cstat_pip.class.inc.php"); 88 88 $obj=new CStat_PIP($prefixeTable, __FILE__); 89 89 set_plugin_data($plugin['id'], $obj); 90 */91 90 } 92 91 -
extensions/ColorStat/maintain.inc.php
r5961 r6107 72 72 } 73 73 GPCCore::register($obj->getPluginName(), CSTAT_VERSION, $gpcNeeded); 74 GPCRequestBuilder::register($obj->getPluginName(), dirname($obj->getFileLocation()).'/cstat_rb_callback.class.inc.php'); 74 75 } 75 76 else … … 117 118 $obj = new CStat_Install($prefixeTable, __FILE__); 118 119 $obj->uninstall(); 120 GPCRequestBuilder::unregister($obj->getPluginName()); 119 121 GPCCore::unregister($obj->getPluginName()); 120 122 } -
extensions/ColorStat/templates/cstat_color_table.tpl
r5961 r6107 1 <table {if $data.id!=''}id="{$data s.id}"{/if} {if $data.class!=''}class="{$data.class}"{/if} style="border-collapse:collapse;">1 <table {if $data.id!=''}id="{$data.id}"{/if} {if $data.class!=''}class="{$data.class}"{/if} > 2 2 {foreach from=$data.colorTable item=row} 3 3 <tr> 4 4 {foreach from=$row item=col} 5 <td style="width:{$data.size}px;height:{$data.size}px;background-color:#{$col.color};" 6 title="{'cstat_color'|@translate} #{$col.color} {if $col.num!=''} - {$col.num} {'cstat_images'|@translate}{/if} {if $col.pct!=''} - {'cstat_surface'|@translate} {$col.pct}%{/if} "></td> 5 <td id="cellColor_{$col.color}" style="width:{$data.size}px;height:{$data.size}px;background-color:#{$col.color};{if $col.num!=''}cursor:pointer;{/if}" class="tiptip {if $col.num!=''}csSelectable{/if}" 6 title="{'cstat_color'|@translate} #{$col.color}{if $col.num!=''} : {$col.num} {'cstat_images'|@translate}{/if}{if $col.pct!=''} {$data.br} {'cstat_surface'|@translate} {$col.pct}%{/if}"> 7 </td> 7 8 {/foreach} 8 9 </tr>
Note: See TracChangeset
for help on using the changeset viewer.