Changeset 11853 for trunk/admin
- Timestamp:
- Jul 30, 2011, 6:49:02 AM (13 years ago)
- Location:
- trunk/admin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/batch_manager.php
r11039 r11853 67 67 $_SESSION['bulk_manager_filter']['category_recursive'] = true; 68 68 } 69 } 70 71 if (isset($_POST['filter_tags_use'])) 72 { 73 $_SESSION['bulk_manager_filter']['tags'] = get_tag_ids($_POST['filter_tags'], false); 69 74 } 70 75 … … 291 296 } 292 297 298 if (!empty($_SESSION['bulk_manager_filter']['tags'])) 299 { 300 $query = ' 301 SELECT image_id 302 FROM '.IMAGE_TAG_TABLE. 303 'WHERE tag_id IN('.implode(',',$_SESSION['bulk_manager_filter']['tags']).') 304 GROUP BY image_id 305 HAVING COUNT(tag_id)='.count($_SESSION['bulk_manager_filter']['tags']); 306 array_push( 307 $filter_sets, 308 get_image_ids_for_tags($_SESSION['bulk_manager_filter']['tags']) 309 ); 310 } 311 293 312 $current_set = array_shift($filter_sets); 294 313 foreach ($filter_sets as $set) … … 366 385 367 386 $query = ' 368 SELECT 369 id AS tag_id, 370 name AS tag_name 387 SELECT id, name 371 388 FROM '.TAGS_TABLE.' 372 389 ;'; -
trunk/admin/batch_manager_global.php
r11039 r11853 538 538 ) 539 539 ); 540 541 if (!empty($_SESSION['bulk_manager_filter']['tags'])) 542 { 543 $query = ' 544 SELECT id, name 545 FROM '.TAGS_TABLE.' 546 WHERE id IN ('.implode(',', $_SESSION['bulk_manager_filter']['tags']).')'; 547 $template->assign('filter_tags', get_taglist($query)); 548 } 540 549 541 550 // Virtualy associate a picture to a category -
trunk/admin/batch_manager_unit.php
r11220 r11853 252 252 $query = ' 253 253 SELECT 254 tag_id,255 name AS tag_name254 id, 255 name 256 256 FROM '.IMAGE_TAG_TABLE.' AS it 257 257 JOIN '.TAGS_TABLE.' AS t ON t.id = it.tag_id -
trunk/admin/include/functions.php
r11828 r11853 2049 2049 while ($row = pwg_db_fetch_assoc($result)) 2050 2050 { 2051 if (preg_match_all('#\[lang=(.*?)\](.*?)\[/lang\]#is', $row[' tag_name'], $matches))2051 if (preg_match_all('#\[lang=(.*?)\](.*?)\[/lang\]#is', $row['name'], $matches)) 2052 2052 { 2053 2053 foreach ($matches[2] as $tag_name) … … 2057 2057 array( 2058 2058 'name' => trigger_event('render_tag_name', $tag_name), 2059 'id' => '~~'.$row[' tag_id'].'~~',2059 'id' => '~~'.$row['id'].'~~', 2060 2060 ) 2061 2061 ); … … 2065 2065 } 2066 2066 2067 if (strlen($row[' tag_name']) > 0)2067 if (strlen($row['name']) > 0) 2068 2068 { 2069 2069 array_push( 2070 2070 $taglist, 2071 2071 array( 2072 'name' => trigger_event('render_tag_name', $row[' tag_name']),2073 'id' => '~~'.$row[' tag_id'].'~~',2072 'name' => trigger_event('render_tag_name', $row['name']), 2073 'id' => '~~'.$row['id'].'~~', 2074 2074 ) 2075 2075 ); … … 2083 2083 } 2084 2084 2085 function get_tag_ids($raw_tags )2085 function get_tag_ids($raw_tags, $allow_create=true) 2086 2086 { 2087 2087 // In $raw_tags we receive something like array('~~6~~', '~~59~~', 'New … … 2099 2099 array_push($tag_ids, $matches[1]); 2100 2100 } 2101 else 2101 elseif ($allow_create) 2102 2102 { 2103 2103 // we have to create a new tag 2104 array_push( 2105 $tag_ids, 2106 tag_id_from_tag_name($raw_tag) 2107 ); 2104 $tag_ids[] = tag_id_from_tag_name($raw_tag); 2108 2105 } 2109 2106 } -
trunk/admin/picture_modify.php
r11220 r11853 228 228 $query = ' 229 229 SELECT 230 tag_id,231 name AS tag_name230 id, 231 name 232 232 FROM '.IMAGE_TAG_TABLE.' AS it 233 233 JOIN '.TAGS_TABLE.' AS t ON t.id = it.tag_id … … 238 238 $query = ' 239 239 SELECT 240 id AS tag_id,241 name AS tag_name240 id, 241 name 242 242 FROM '.TAGS_TABLE.' 243 243 ;'; -
trunk/admin/themes/default/template/batch_manager_global.tpl
r11754 r11853 12 12 {footer_script require='jquery.tokeninput'} 13 13 jQuery(document).ready(function() {ldelim} 14 var tag_src = [{foreach from=$tags item=tag name=tags}{ldelim}name:"{$tag.name|@escape:'javascript'}",id:"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}]; 14 15 jQuery("#tags").tokenInput( 15 [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name|@escape:'javascript'}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}],16 tag_src, 16 17 {ldelim} 17 18 hintText: '{'Type in a search term'|@translate}', … … 24 25 } 25 26 ); 27 28 jQuery("#tagsFilter").tokenInput( 29 tag_src, 30 {ldelim} 31 hintText: '{'Type in a search term'|@translate}', 32 noResultsText: '{'No results'|@translate}', 33 searchingText: '{'Searching...'|@translate}', 34 animateDropdown: false, 35 preventDuplicates: true, 36 allowCreation: false 37 } 38 ); 39 26 40 }); 27 41 {/footer_script} … … 467 481 <label><input type="checkbox" name="filter_category_recursive" {if isset($filter.category_recursive)}checked="checked"{/if}> {'include child albums'|@translate}</label> 468 482 </li> 483 <li id="filter_tags" {if !isset($filter.tags)}style="display:none"{/if}> 484 <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> 485 <input type="checkbox" name="filter_tags_use" class="useFilterCheckbox" {if isset($filter.tags)}checked="checked"{/if}> 486 {'Tags'|@translate} 487 <select id="tagsFilter" name="filter_tags"> 488 {foreach from=$filter_tags item=tag} 489 <option value="{$tag.id}">{$tag.name}</option> 490 {/foreach} 491 </select> 492 </li> 469 493 <li id="filter_level" {if !isset($filter.level)}style="display:none"{/if}> 470 494 <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> … … 483 507 <option value="filter_prefilter">{'predefined filter'|@translate}</option> 484 508 <option value="filter_category">{'album'|@translate}</option> 509 <option value="filter_tags">{'Tags'|@translate}</option> 485 510 <option value="filter_level">{'Who can see these photos?'|@translate}</option> 486 511 </select>
Note: See TracChangeset
for help on using the changeset viewer.