Changeset 11854
- Timestamp:
- Jul 30, 2011, 6:53:18 AM (13 years ago)
- Location:
- branches/2.2/admin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/admin/batch_manager.php
r11056 r11854 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 ;'; -
branches/2.2/admin/batch_manager_global.php
r11056 r11854 486 486 ) 487 487 ); 488 489 if (!empty($_SESSION['bulk_manager_filter']['tags'])) 490 { 491 $query = ' 492 SELECT id, name 493 FROM '.TAGS_TABLE.' 494 WHERE id IN ('.implode(',', $_SESSION['bulk_manager_filter']['tags']).')'; 495 $template->assign('filter_tags', get_taglist($query)); 496 } 488 497 489 498 // Virtualy associate a picture to a category -
branches/2.2/admin/batch_manager_unit.php
r11221 r11854 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 -
branches/2.2/admin/include/functions.php
r11727 r11854 2116 2116 $taglist, 2117 2117 array( 2118 'name' => $row[' tag_name'],2119 'id' => '~~'.$row[' tag_id'].'~~',2118 'name' => $row['name'], 2119 'id' => '~~'.$row['id'].'~~', 2120 2120 ) 2121 2121 ); … … 2128 2128 } 2129 2129 2130 function get_tag_ids($raw_tags )2130 function get_tag_ids($raw_tags, $allow_create=true) 2131 2131 { 2132 2132 // In $raw_tags we receive something like array('~~6~~', '~~59~~', 'New … … 2144 2144 array_push($tag_ids, $matches[1]); 2145 2145 } 2146 else 2146 elseif ($allow_create) 2147 2147 { 2148 2148 // we have to create a new tag 2149 array_push( 2150 $tag_ids, 2151 tag_id_from_tag_name($raw_tag) 2152 ); 2149 $tag_ids[] = tag_id_from_tag_name($raw_tag); 2153 2150 } 2154 2151 } -
branches/2.2/admin/picture_modify.php
r11221 r11854 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 ;'; -
branches/2.2/admin/themes/default/template/batch_manager_global.tpl
r11211 r11854 10 10 {footer_script require='jquery.tokeninput'} 11 11 jQuery(document).ready(function() {ldelim} 12 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}]; 12 13 jQuery("#tags").tokenInput( 13 [{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 tag_src, 14 15 {ldelim} 15 16 hintText: '{'Type in a search term'|@translate}', … … 22 23 } 23 24 ); 25 26 jQuery("#tagsFilter").tokenInput( 27 tag_src, 28 {ldelim} 29 hintText: '{'Type in a search term'|@translate}', 30 noResultsText: '{'No results'|@translate}', 31 searchingText: '{'Searching...'|@translate}', 32 animateDropdown: false, 33 preventDuplicates: true, 34 allowCreation: false 35 } 36 ); 37 24 38 }); 25 39 {/footer_script} … … 347 361 <label><input type="checkbox" name="filter_category_recursive" {if isset($filter.category_recursive)}checked="checked"{/if}> {'include child albums'|@translate}</label> 348 362 </li> 363 <li id="filter_tags" {if !isset($filter.tags)}style="display:none"{/if}> 364 <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> 365 <input type="checkbox" name="filter_tags_use" class="useFilterCheckbox" {if isset($filter.tags)}checked="checked"{/if}> 366 {'Tags'|@translate} 367 <select id="tagsFilter" name="filter_tags"> 368 {foreach from=$filter_tags item=tag} 369 <option value="{$tag.id}">{$tag.name}</option> 370 {/foreach} 371 </select> 372 </li> 349 373 <li id="filter_level" {if !isset($filter.level)}style="display:none"{/if}> 350 374 <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> … … 363 387 <option value="filter_prefilter">{'predefined filter'|@translate}</option> 364 388 <option value="filter_category">{'album'|@translate}</option> 389 <option value="filter_tags">{'Tags'|@translate}</option> 365 390 <option value="filter_level">{'Who can see these photos?'|@translate}</option> 366 391 </select>
Note: See TracChangeset
for help on using the changeset viewer.