Changeset 7349 for extensions
- Timestamp:
- Oct 22, 2010, 10:07:46 PM (14 years ago)
- Location:
- extensions/GrumPluginClasses
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GrumPluginClasses/css/categorySelector_clear.css
r7175 r7349 54 54 55 55 li.ui-category-selector-item:hover { 56 background-color:#999999; 56 background-color:#AAAAAA; 57 color:#DDDDDD; 57 58 } 58 59 59 60 .ui-category-selector-selected-item { 60 background-color:#AAAAAA; 61 background-color:#999999; 62 color:#DDDDDD; 61 63 } 62 64 -
extensions/GrumPluginClasses/gpc_ajax.php
r7327 r7349 20 20 * - admin.rbuilder.fillCaddie 21 21 * - admin.categorySelector.getList 22 * - public.categorySelector.getList 23 * - public.rbuilder.searchExecute 24 * - public.rbuilder.searchGetPage 25 * - public.tagSelector.get 26 * - admin.tagSelector.get 27 * 22 28 * 23 29 * ----------------------------------------------------------------------------- … … 80 86 $_REQUEST['ajaxfct']=='public.rbuilder.searchGetPage' or 81 87 $_REQUEST['ajaxfct']=='admin.categorySelector.getList' or 82 $_REQUEST['ajaxfct']=='public.categorySelector.getList' 88 $_REQUEST['ajaxfct']=='public.categorySelector.getList' or 89 $_REQUEST['ajaxfct']=='public.tagSelector.get' or 90 $_REQUEST['ajaxfct']=='admin.tagSelector.get' 83 91 ) 84 92 ) $_REQUEST['ajaxfct']=''; … … 127 135 128 136 /* 129 * check admin.categorySelector.getList values 137 * check admin.tagSelector.get values 138 */ 139 if($_REQUEST['ajaxfct']=="admin.tagSelector.get" or 140 $_REQUEST['ajaxfct']=="public.tagSelector.get") 141 { 142 if(!isset($_REQUEST['letters'])) $_REQUEST['ajaxfct']=""; 143 if(!isset($_REQUEST['filter'])) $_REQUEST['filter']="affected"; 144 145 if(!($_REQUEST['filter']=="affected" or 146 $_REQUEST['filter']=="all") 147 ) $_REQUEST['filter']="affected"; 148 149 if(!isset($_REQUEST['maxTags'])) $_REQUEST['maxTags']=1000; 150 if($_REQUEST['maxTags']<0) $_REQUEST['maxTags']=0; 151 152 if(!isset($_REQUEST['ignoreCase'])) $_REQUEST['ignoreCase']=true; 153 154 } 155 156 157 /* 158 * check public.categorySelector.getList values 130 159 */ 131 160 if($_REQUEST['ajaxfct']=="admin.categorySelector.getList" or … … 152 181 } 153 182 154 155 183 } 156 184 } //checkRequest() … … 179 207 case 'public.categorySelector.getList': 180 208 $result=$this->ajax_gpc_public_CategorySelectorGetList($_REQUEST['filter'], $_REQUEST['galleryRoot'], $_REQUEST['tree']); 209 break; 210 case 'admin.tagSelector.get': 211 $result=$this->ajax_gpc_both_TagSelectorGet('admin', $_REQUEST['letters'], $_REQUEST['filter'], $_REQUEST['maxTags'], $_REQUEST['ignoreCase']); 212 break; 213 case 'public.tagSelector.get': 214 $result=$this->ajax_gpc_both_TagSelectorGet('public', $_REQUEST['letters'], $_REQUEST['filter'], $_REQUEST['maxTags'], $_REQUEST['ignoreCase']); 181 215 break; 182 216 } … … 322 356 323 357 358 359 /** 360 * return the list of all known tags 361 * 362 * @param Striong $mode : 'admin' or 'public' 363 * @param String $letters : filtering on letters 364 * @param String $filter : 'accessible' or 'all' 365 * @param Integer $maxTags : maximum of items returned ; 0 = no limits 366 * @return String : json string 367 */ 368 private function ajax_gpc_both_TagSelectorGet($mode, $letters, $filter, $maxTags, $ignoreCase) 369 { 370 global $user; 371 372 $returned=array( 373 'totalNbTags' => 0, 374 'tags' => array(), 375 ); 376 377 $binary=''; 378 if(!$ignoreCase) $binary=" BINARY "; 379 380 381 $sql="SELECT DISTINCT SQL_CALC_FOUND_ROWS ptt.id, ptt.name 382 FROM ((".TAGS_TABLE." ptt "; 383 384 if($filter=='affected') 385 { 386 $sql.=" JOIN ".IMAGE_TAG_TABLE." pitt 387 ON pitt.tag_id = ptt.id ) "; 388 } 389 else 390 { 391 $sql.=" ) "; 392 } 393 394 395 if($mode=='public' and $filter=='affected') 396 { 397 $sql.=" JOIN ".IMAGE_CATEGORY_TABLE." pict 398 ON pict.image_id = pitt.image_id ) 399 JOIN ".USER_CACHE_CATEGORIES_TABLE." pucc 400 ON (pucc.cat_id = pict.category_id AND pucc.user_id='".$user['id']."' )"; 401 } 402 else 403 { 404 $sql.=" ) "; 405 } 406 407 $sql.=" WHERE ptt.name LIKE $binary '%$letters%' 408 ORDER BY ptt.name "; 409 410 if($maxTags>0) $sql.=" LIMIT 0, ".$maxTags; 411 412 $result=pwg_query($sql); 413 if($result) 414 { 415 while($row=pwg_db_fetch_assoc($result)) 416 { 417 $returned['tags'][]=$row; 418 } 419 420 $sql="SELECT FOUND_ROWS();"; 421 $result=pwg_query($sql); 422 if($result) 423 { 424 while($row=pwg_db_fetch_row($result)) 425 { 426 $returned['totalNbTags']=$row[0]; 427 } 428 } 429 } 430 431 return(json_encode($returned)); 432 } //ajax_gpc_both_TagSelectorGet 433 434 324 435 } //class 325 436 326 437 327 438 $returned=new GPC_Ajax($prefixeTable, __FILE__); 439 440 441 442 443 328 444 ?> -
extensions/GrumPluginClasses/main.inc.php
r7327 r7349 85 85 | | | and templates 86 86 | | | 87 | | | * Add the jQuery plugins 88 | | | . ui.tagSelector.js + ui.tagSelector.packed.js 89 | | | 90 | | | 91 | | | 87 92 | | | 88 93 | | | ===== Don't forget to update the plugin version ! ===== -
extensions/GrumPluginClasses/templates/GPCRequestBuilder_search.tpl
r7327 r7349 376 376 {/foreach} 377 377 378 $('.ui-dialog').css('overflow', 'visible'); 379 378 380 init(); 379 381 </script>
Note: See TracChangeset
for help on using the changeset viewer.