{combine_css path=$SMART_PATH|@cat:"admin/template/style.css"} {include file='include/datepicker.inc.tpl'} {combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} {combine_css path="themes/default/js/plugins/chosen.css"} {combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} {footer_script require='jquery.tokeninput,jquery.chosen'} var lang = new Array(); var options = new Array(); {foreach from=$options item=details key=mode} lang['{$mode}_filter'] = '{$details.name|escape:javascript}'; {capture assign="option_content"}{html_options options=$details.options}{/capture} options['{$mode}'] = "{$option_content|escape:javascript}"; {/foreach} lang['Select albums...'] = '{'Select albums...'|@translate}'; lang['For "Is (not) in", separate each author by a comma'] = '{'For "Is (not) in", separate each author by a comma'|@translate|escape:javascript}'; lang['remove this filter'] = '{'remove this filter'|@translate|escape:javascript}'; {capture assign="option_content"}{html_options options=$level_options selected=0}{/capture} options['level_options'] = "{$option_content|escape:javascript}"; {capture assign="option_content"}{html_options options=$all_albums selected=0}{/capture} options['album_options'] = "{$option_content|escape:javascript}"; {literal} $('#addFilter').change(function() { add_filter($(this).attr('value')); $(this).attr('value', '-1'); }); $('#removeFilters').click(function() { $('#filterList li').each(function() { $(this).remove(); }); return false; }); $('input[name="is_smart"]').change(function() { $('#SmartAlbum_options').toggle(); $('input[name="countImages"]').toggle(); $('.count_images_wrapper').toggle(); }); $('input[name="countImages"]').click(function() { countImages($("#smart")); return false; }); function add_filter(type) { // add line $('
  • ').appendTo('#filterList'); //set content content = ' '+ ' [x]'+ '  '+ lang[type +'_filter'] + ''+ ' '+ ' '+ ''+ ' '; if (type == 'tags') { content+= ' '; } else if (type == 'album') { content+= ' '; } else if (type == 'level') { content+= ' '; } else { content+= ' '; } if (type == 'author') { content+= ' '+ lang['For "Is (not) in", separate each author by a comma'] +''; } content+= ''; $('#filter_'+ i).html(content); // reinit handlers init_jquery_handlers(); i++; } function init_jquery_handlers() { $('.removeFilter').click(function() { $(this).parents('li').remove(); return false; }); $('.filter_date input[type="text"]').each(function() { $(this).datepicker({dateFormat:'yy-mm-dd', firstDay:1}); }); jQuery(".tagSelect").tokenInput( {/literal} [{foreach from=$all_tags item=tag name=tags}{ldelim}"name":"{$tag.name|@escape:'javascript'}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}], {ldelim} hintText: '{'Type in a search term'|@translate}', noResultsText: '{'No results'|@translate}', searchingText: '{'Searching...'|@translate}', animateDropdown: false, preventDuplicates: true, allowCreation: false {literal} } ); jQuery(".albumSelect").chosen(); } function countImages(form) { {/literal} jQuery.post("{$COUNT_SCRIPT_URL}", 'cat_id={$CAT_ID}&'+form.serialize(), {literal} function success(data) { jQuery('.count_images_wrapper').html(data); } ); } function doBlink(obj,start,finish) { jQuery(obj).fadeOut(400).fadeIn(400); if(start!=finish) { doBlink(obj,start+1,finish); } else { jQuery(obj).fadeOut(400); } } init_jquery_handlers(); {/literal} {if isset($new_smart)}doBlink('.new_smart', 0, 3);{/if} {/footer_script}

    {$CATEGORIES_NAV} › {'Edit album'|@translate} [SmartAlbum]

    {'Filters'|@translate}
      {counter start=0 assign=i} {foreach from=$filters item=filter}
    • [x] {$filter.CAPTION} {if $filter.TYPE == 'tags'} {elseif $filter.TYPE == 'album'} {elseif $filter.TYPE == 'level'} {else} {/if} {if $filter.TYPE == 'author'} {'For "Is (not) in", separate each author by a comma'|@translate} {/if}
    • {counter} {/foreach} {footer_script}var i={$i};{/footer_script}

    {'Remove all filters'|@translate} {if isset($new_smart)}{'Add filters here'|@translate}{/if}

    {$IMAGE_COUNT}