Index: /extensions/SmartAlbums/admin.php
===================================================================
--- /extensions/SmartAlbums/admin.php	(revision 26724)
+++ /extensions/SmartAlbums/admin.php	(revision 26725)
@@ -22,5 +22,8 @@
 }
 
-$template->assign('SMART_PATH', SMART_PATH);
+$template->assign(array(
+  'SMART_PATH' => SMART_PATH,
+  'SMART_ABS_PATH' => realpath(SMART_PATH) . '/',
+  ));
 
 $template->assign_var_from_handle('ADMIN_CONTENT', 'SmartAlbums_content');
Index: /extensions/SmartAlbums/admin/template/addFilters.js
===================================================================
--- /extensions/SmartAlbums/admin/template/addFilters.js	(revision 26725)
+++ /extensions/SmartAlbums/admin/template/addFilters.js	(revision 26725)
@@ -0,0 +1,226 @@
+var addFilter = (function($){
+  var count=0,
+      limit_count=0,
+      level_count=0;
+
+  // MAIN EVENT HANDLERS
+  $('#addFilter').change(function() {
+    if ($(this).val() != -1) {
+      add_filter($(this).val());
+      $(this).val(-1);
+    }
+  });
+
+  $('#removeFilters').click(function() {
+    $('#filtersList li').each(function() {
+      $(this).remove();
+    });
+
+    limit_level=0;
+    level_count=0;
+    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;
+  });
+
+
+  // ADD FILTER FUNCTIONS
+  function add_filter(type, cond, value) {
+    count++;
+
+    var content = $("#filtersRepo #filter_"+type).html().replace(/iiii/g, count);
+    $block = $($.parseHTML(content)).appendTo("#filtersList");
+
+    if (cond) {
+      select_cond($block, type, cond);
+    }
+
+    if (value) {
+      if (type == "tags") {
+        $block.find(".filter-value .tagSelect").html(value);
+      }
+      else if (type == "album") {
+        select_options($block, value);
+      }
+      else if (type == "level") {
+        select_options($block, value);
+      }
+      else if (type != "dimensions") {
+        $block.find(".filter-value input").val(value);
+      }
+    }
+
+    init_jquery_handlers($block);
+
+    if (type == "dimensions") {
+      select_dimensions($block, cond, value);
+    }
+
+    if (type == 'limit') {
+      limit_count=1;
+      $("#addFilter option[value='limit']").attr('disabled','disabled');
+    }
+    else if (type == 'level') {
+      level_count=1;
+      $("#addFilter option[value='level']").attr('disabled','disabled');
+    }
+  }
+
+  function select_cond($block, type, cond) {
+    $block.find(".filter-cond option").removeAttr('selected');
+    $block.find(".filter-cond option[value='"+cond+"']").attr('selected', 'selected');
+  }
+
+  function select_dimensions($block, cond, value) {
+    console.log($block, cond, value);
+    cond = cond || 'width';
+
+    $block.find(">.filter-value>span").hide();
+    $block.find(".dimension_"+cond).show();
+
+    if (value) {
+      values = value.split(',');
+    }
+    else {
+      values = $block.find(".filter_dimension_"+cond+"_slider").slider("values");
+    }
+    $block.find(".filter_dimension_"+cond+"_slider").slider("values", values);
+  }
+
+  function select_options($block, value) {
+    values = value.split(',');
+    for (j in values) {
+      $block.find(".filter-value option[value='"+ values[j] +"']").attr('selected', 'selected');
+    }
+  }
+
+
+  // DECLARE JQUERY PLUGINS AND VERSATILE HANDLERS
+  function init_jquery_handlers($block) {
+    // remove filter
+    $block.find(".removeFilter").click(function() {
+      type = $(this).next("input").val();
+      if (type == 'limit') {
+        limit_count=1;
+        $("#addFilter option[value='limit']").removeAttr('disabled');
+      }
+      else if (type == 'level') {
+        level_count=1;
+        $("#addFilter option[value='level']").removeAttr('disabled');
+      }
+
+      $(this).parents('li').remove();
+      return false;
+    });
+
+    // date filter
+    if ($block.hasClass('filter_date')) {
+      $block.find("input[type='text']").each(function() {
+        $(this).datepicker({
+          dateFormat:'yy-mm-dd',
+          firstDay:1
+        });
+      });
+    }
+
+    // tags filter
+    if ($block.hasClass('filter_tags')) {
+      $block.find(".tagSelect").tokenInput(
+        [{foreach from=$all_tags item=tag name=tags}{ name:"{$tag.name|escape:javascript}", id:"{$tag.id}" }{if !$smarty.foreach.tags.last},{/if}{/foreach}],
+        {
+          hintText: '{'Type in a search term'|translate}',
+          noResultsText: '{'No results'|translate}',
+          searchingText: '{'Searching...'|translate}',
+          animateDropdown: false,
+          preventDuplicates: true,
+          allowFreeTagging: false
+        }
+      );
+    }
+
+    // album filter
+    if ($block.hasClass('filter_album')) {
+      $block.find(".albumSelect").chosen();
+    }
+
+    // dimension filter
+    if ($block.hasClass('filter_dimensions')) {
+      $block.find(".filter-cond select").change(function() {
+        select_dimensions($block, $(this).val());
+      });
+
+      $block.find(".filter_dimension_width_slider").slider({
+        range: true,
+        min: {$dimensions.bounds.min_width},
+        max: {$dimensions.bounds.max_width},
+        values: [{$dimensions.bounds.min_width}, {$dimensions.bounds.max_width}],
+        slide: function(event, ui) {
+          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
+        },
+        change: function(event, ui) {
+          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
+        }
+      });
+
+      $block.find(".filter_dimension_height_slider").slider({
+        range: true,
+        min: {$dimensions.bounds.min_height},
+        max: {$dimensions.bounds.max_height},
+        values: [{$dimensions.bounds.min_height}, {$dimensions.bounds.max_height}],
+        slide: function(event, ui) {
+          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
+        },
+        change: function(event, ui) {
+          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
+        }
+      });
+
+      $block.find(".filter_dimension_ratio_slider").slider({
+        range: true,
+        step: 0.01,
+        min: {$dimensions.bounds.min_ratio},
+        max: {$dimensions.bounds.max_ratio},
+        values: [{$dimensions.bounds.min_ratio}, {$dimensions.bounds.max_ratio}],
+        slide: function(event, ui) {
+          change_dimension_info($block, ui.values, "{'between %.2f and %.2f'|translate}");
+        },
+        change: function(event, ui) {
+          change_dimension_info($block, ui.values, "{'between %.2f and %.2f'|translate}");
+        }
+      });
+
+      $block.find("a.dimensions-choice").click(function() {
+        $block.find(".filter_dimension_"+ $(this).data("type") +"_slider").slider("values",
+          [$(this).data("min"), $(this).data("max")]
+        );
+      });
+    }
+  }
+
+
+  // GENERAL FUNCTIONS
+  function change_dimension_info($block, values, text) {
+    $block.find("input[name$='[value][min]']").val(values[0]);
+    $block.find("input[name$='[value][max]']").val(values[1]);
+    $block.find(".filter_dimension_info").html(sprintf(text, values[0], values[1]));
+  }
+
+  function countImages(form) {
+    jQuery.post("{$COUNT_SCRIPT_URL}", 'cat_id={$CAT_ID}&'+form.serialize(),
+      function success(data) {
+        jQuery('.count_images_wrapper').html(data);
+      }
+    );
+  }
+
+  return add_filter; // expose add_filter method
+}(jQuery));
Index: /extensions/SmartAlbums/admin/template/album.tpl
===================================================================
--- /extensions/SmartAlbums/admin/template/album.tpl	(revision 26724)
+++ /extensions/SmartAlbums/admin/template/album.tpl	(revision 26725)
@@ -12,250 +12,21 @@
 {combine_script id='jquery.ui.slider' require='jquery.ui' load='footer' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'}
 
-{*combine_script id='smartalbums.filters' require='common,datepicker.js,jquery.tokeninput,jquery.chosen,jquery.ui.slider'
-  path=$SMART_PATH|cat:'admin/template/filters.js' load='footer' template=true*}
+{combine_script id='smartalbums.filters' load='footer' template=true path=$SMART_PATH|cat:'admin/template/addFilters.js'}
 
+{if isset($new_smart)}
 {footer_script require='jquery'}
-var addFilter = (function($){
-  var count=0,
-      limit_count=0,
-      level_count=0;
+function doBlink(obj,start,finish) {
+  jQuery(obj).fadeOut(400).fadeIn(400);
+  if(start!=finish) {
+    doBlink(obj,start+1,finish);
+  }
+  else {
+    jQuery(obj).fadeOut(400);
+  }
+}
 
-  // MAIN EVENT HANDLERS
-  $('#addFilter').change(function() {
-    if ($(this).val() != -1) {
-      add_filter($(this).val());
-      $(this).val(-1);
-    }
-  });
-
-  $('#removeFilters').click(function() {
-    $('#filtersList li').each(function() {
-      $(this).remove();
-    });
-
-    limit_level=0;
-    level_count=0;
-    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;
-  });
-
-
-  // ADD FILTER FUNCTIONS
-  function add_filter(type, cond, value) {
-    count++;
-
-    var content = $("#filtersRepo #filter_"+type).html().replace(/iiii/g, count);
-    $block = $($.parseHTML(content)).appendTo("#filtersList");
-
-    if (cond) {
-      select_cond($block, type, cond);
-    }
-
-    if (value) {
-      if (type == "tags") {
-        $block.find(".filter-value .tagSelect").html(value);
-      }
-      else if (type == "album") {
-        select_options($block, value);
-      }
-      else if (type == "level") {
-        select_options($block, value);
-      }
-      else if (type != "dimensions") {
-        $block.find(".filter-value input").val(value);
-      }
-    }
-
-    init_jquery_handlers($block);
-
-    if (type == "dimensions") {
-      select_dimensions($block, cond, value);
-    }
-
-    if (type == 'limit') {
-      limit_count=1;
-      $("#addFilter option[value='limit']").attr('disabled','disabled');
-    }
-    else if (type == 'level') {
-      level_count=1;
-      $("#addFilter option[value='level']").attr('disabled','disabled');
-    }
-  }
-
-  function select_cond($block, type, cond) {
-    $block.find(".filter-cond option").removeAttr('selected');
-    $block.find(".filter-cond option[value='"+cond+"']").attr('selected', 'selected');
-  }
-
-  function select_dimensions($block, cond, value) {
-    console.log($block, cond, value);
-    cond = cond || 'width';
-
-    $block.find(">.filter-value>span").hide();
-    $block.find(".dimension_"+cond).show();
-
-    if (value) {
-      values = value.split(',');
-    }
-    else {
-      values = $block.find(".filter_dimension_"+cond+"_slider").slider("values");
-    }
-    $block.find(".filter_dimension_"+cond+"_slider").slider("values", values);
-  }
-
-  function select_options($block, value) {
-    values = value.split(',');
-    for (j in values) {
-      $block.find(".filter-value option[value='"+ values[j] +"']").attr('selected', 'selected');
-    }
-  }
-
-
-  // DECLARE JQUERY PLUGINS AND VERSATILE HANDLERS
-  function init_jquery_handlers($block) {
-    // remove filter
-    $block.find(".removeFilter").click(function() {
-      type = $(this).next("input").val();
-      if (type == 'limit') {
-        limit_count=1;
-        $("#addFilter option[value='limit']").removeAttr('disabled');
-      }
-      else if (type == 'level') {
-        level_count=1;
-        $("#addFilter option[value='level']").removeAttr('disabled');
-      }
-
-      $(this).parents('li').remove();
-      return false;
-    });
-
-    // date filter
-    if ($block.hasClass('filter_date')) {
-      $block.find("input[type='text']").each(function() {
-        $(this).datepicker({
-          dateFormat:'yy-mm-dd',
-          firstDay:1
-        });
-      });
-    }
-
-    // tags filter
-    if ($block.hasClass('filter_tags')) {
-      $block.find(".tagSelect").tokenInput(
-        [{foreach from=$all_tags item=tag name=tags}{ name:"{$tag.name|escape:javascript}", id:"{$tag.id}" }{if !$smarty.foreach.tags.last},{/if}{/foreach}],
-        {
-          hintText: '{'Type in a search term'|translate}',
-          noResultsText: '{'No results'|translate}',
-          searchingText: '{'Searching...'|translate}',
-          animateDropdown: false,
-          preventDuplicates: true,
-          allowFreeTagging: false
-        }
-      );
-    }
-
-    // album filter
-    if ($block.hasClass('filter_album')) {
-      $block.find(".albumSelect").chosen();
-    }
-
-    // dimension filter
-    if ($block.hasClass('filter_dimensions')) {
-      $block.find(".filter-cond select").change(function() {
-        select_dimensions($block, $(this).val());
-      });
-
-      $block.find(".filter_dimension_width_slider").slider({
-        range: true,
-        min: {$dimensions.bounds.min_width},
-        max: {$dimensions.bounds.max_width},
-        values: [{$dimensions.bounds.min_width}, {$dimensions.bounds.max_width}],
-        slide: function(event, ui) {
-          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
-        },
-        change: function(event, ui) {
-          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
-        }
-      });
-
-      $block.find(".filter_dimension_height_slider").slider({
-        range: true,
-        min: {$dimensions.bounds.min_height},
-        max: {$dimensions.bounds.max_height},
-        values: [{$dimensions.bounds.min_height}, {$dimensions.bounds.max_height}],
-        slide: function(event, ui) {
-          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
-        },
-        change: function(event, ui) {
-          change_dimension_info($block, ui.values, "{'between %d and %d pixels'|translate}");
-        }
-      });
-
-      $block.find(".filter_dimension_ratio_slider").slider({
-        range: true,
-        step: 0.01,
-        min: {$dimensions.bounds.min_ratio},
-        max: {$dimensions.bounds.max_ratio},
-        values: [{$dimensions.bounds.min_ratio}, {$dimensions.bounds.max_ratio}],
-        slide: function(event, ui) {
-          change_dimension_info($block, ui.values, "{'between %.2f and %.2f'|translate}");
-        },
-        change: function(event, ui) {
-          change_dimension_info($block, ui.values, "{'between %.2f and %.2f'|translate}");
-        }
-      });
-
-      $block.find("a.dimensions-choice").click(function() {
-        $block.find(".filter_dimension_"+ $(this).data("type") +"_slider").slider("values",
-          [$(this).data("min"), $(this).data("max")]
-        );
-      });
-    }
-  }
-
-
-  // GENERAL FUNCTIONS
-  function change_dimension_info($block, values, text) {
-    $block.find("input[name$='[value][min]']").val(values[0]);
-    $block.find("input[name$='[value][max]']").val(values[1]);
-    $block.find(".filter_dimension_info").html(sprintf(text, values[0], values[1]));
-  }
-
-  function countImages(form) {
-    jQuery.post("{$COUNT_SCRIPT_URL}", 'cat_id={$CAT_ID}&'+form.serialize(),
-      function success(data) {
-        jQuery('.count_images_wrapper').html(data);
-      }
-    );
-  }
-
-
-  {if isset($new_smart)}
-  function doBlink(obj,start,finish) {
-    jQuery(obj).fadeOut(400).fadeIn(400);
-    if(start!=finish) {
-      doBlink(obj,start+1,finish);
-    }
-    else {
-      jQuery(obj).fadeOut(400);
-    }
-  }
-
-  doBlink('.new_smart', 0, 3);
-  {/if}
-
-  return add_filter; // expose add_filter method
-}(jQuery));
+doBlink('.new_smart', 0, 3);
 {/footer_script}
+{/if}
 
 
@@ -337,241 +108,4 @@
 
 <div id="filtersRepo" style="display:none;">
-  <!-- tags -->
-  <div id="filter_tags">
-  <li id="filter_iiii" class="filter_tags">
-    <span class="filter-title">
-      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
-      <input type="hidden" name="filters[iiii][type]" value="tags"/>
-      {$options.tags.name}
-    </span>
-
-    <span class="filter-cond">
-      <select name="filters[iiii][cond]">
-        {html_options options=$options.tags.options}
-      </select>
-    </span>
-
-    <span class="filter-value">
-      <select name="filters[iiii][value]" class="tagSelect">
-      </select>
-    </span>
-  </li>
-  </div>
-
-  <!-- date -->
-  <div id="filter_date">
-  <li id="filter_iiii" class="filter_date">
-    <span class="filter-title">
-      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
-      <input type="hidden" name="filters[iiii][type]" value="date"/>
-      {$options.date.name}
-    </span>
-
-    <span class="filter-cond">
-      <select name="filters[iiii][cond]">
-        {html_options options=$options.date.options}
-      </select>
-    </span>
-
-    <span class="filter-value">
-      <input type="text" name="filters[iiii][value]" size="30"/>
-    </span>
-  </li>
-  </div>
-
-  <!-- name -->
-  <div id="filter_name">
-  <li id="filter_iiii" class="filter_name">
-    <span class="filter-title">
-      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
-      <input type="hidden" name="filters[iiii][type]" value="name"/>
-      {$options.name.name}
-    </span>
-
-    <span class="filter-cond">
-      <select name="filters[iiii][cond]">
-        {html_options options=$options.name.options}
-      </select>
-    </span>
-
-    <span class="filter-value">
-      <input type="text" name="filters[iiii][value]" size="30"/>
-    </span>
-  </li>
-  </div>
-
-  <!-- album -->
-  <div id="filter_album">
-  <li id="filter_iiii" class="filter_album">
-    <span class="filter-title">
-      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
-      <input type="hidden" name="filters[iiii][type]" value="album"/>
-      {$options.album.name}
-    </span>
-
-    <span class="filter-cond">
-      <select name="filters[iiii][cond]">
-        {html_options options=$options.album.options}
-      </select>
-    </span>
-
-    <span class="filter-value">
-      <select name="filters[iiii][value][]" class="albumSelect" multiple="multiple" data-placeholder="{'Select albums...'|translate}">
-        {html_options options=$all_albums}
-      </select>
-    </span>
-  </li>
-  </div>
-
-  <!-- dimensions -->
-  <div id="filter_dimensions">
-  <li id="filter_iiii" class="filter_dimensions">
-    <span class="filter-title">
-      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
-      <input type="hidden" name="filters[iiii][type]" value="dimensions"/>
-      {$options.dimensions.name}
-    </span>
-
-    <span class="filter-cond">
-      <select name="filters[iiii][cond]">
-        {html_options options=$options.dimensions.options}
-      </select>
-    </span>
-
-    <span class="filter-value">
-      <span class="dimension_width">
-        <span class="filter_dimension_info"></span>
-          | <a class="dimensions-choice" data-type="width" data-min="{$dimensions.bounds.min_width}" data-max="{$dimensions.bounds.max_width}">{'Reset'|translate}</a>
-          <div class="filter_dimension_width_slider"></div>
-      </span>
-
-      <span class="dimension_height">
-        <span class="filter_dimension_info"></span>
-          | <a class="dimensions-choice" data-type="height" data-min="{$dimensions.bounds.min_height}" data-max="{$dimensions.bounds.max_height}">{'Reset'|translate}</a>
-          <div class="filter_dimension_height_slider"></div>
-      </span>
-
-      <span class="dimension_ratio">
-        <span class="filter_dimension_info"></span>
-        {if isset($dimensions.ratio_portrait)}
-          | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_portrait.min}" data-max="{$dimensions.ratio_portrait.max}">{'Portrait'|translate}</a>
-        {/if}
-        {if isset($dimensions.ratio_square)}
-          | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_square.min}" data-max="{$dimensions.ratio_square.max}">{'square'|translate}</a>
-        {/if}
-        {if isset($dimensions.ratio_landscape)}
-          | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_landscape.min}" data-max="{$dimensions.ratio_landscape.max}">{'Landscape'|translate}</a>
-        {/if}
-        {if isset($dimensions.ratio_panorama)}
-          | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_panorama.min}" data-max="{$dimensions.ratio_panorama.max}">{'Panorama'|translate}</a>
-        {/if}
-          | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.bounds.min_ratio}" data-max="{$dimensions.bounds.max_ratio}">{'Reset'|translate}</a>
-          <div class="filter_dimension_ratio_slider"></div>
-      </span>
-    </span>
-
-    <input type="hidden" name="filters[iiii][value][min]" value="">
-    <input type="hidden" name="filters[iiii][value][max]" value="">
-  </li>
-  </div>
-
-  <!-- author -->
-  <div id="filter_author">
-  <li id="filter_iiii" class="filter_author">
-    <span class="filter-title">
-      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
-      <input type="hidden" name="filters[iiii][type]" value="author"/>
-      {$options.author.name}
-    </span>
-
-    <span class="filter-cond">
-      <select name="filters[iiii][cond]">
-        {html_options options=$options.author.options}
-      </select>
-    </span>
-
-    <span class="filter-value">
-      <input type="text" name="filters[iiii][value]" size="30"/>
-      <i>{'For "Is (not) in", separate each author by a comma'|translate}</i>
-    </span>
-  </li>
-  </div>
-
-  <!-- hit -->
-  <div id="filter_hit">
-  <li id="filter_iiii" class="filter_hit">
-    <span class="filter-title">
-      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
-      <input type="hidden" name="filters[iiii][type]" value="hit"/>
-      {$options.hit.name}
-    </span>
-
-    <span class="filter-cond">
-      <select name="filters[iiii][cond]">
-        {html_options options=$options.hit.options}
-      </select>
-    </span>
-
-    <span class="filter-value">
-      <input type="text" name="filters[iiii][value]" size="5"/>
-    </span>
-  </li>
-  </div>
-
-  <!-- rating_score -->
-  <div id="filter_rating_score">
-  <li id="filter_iiii" class="filter_rating_score">
-    <span class="filter-title">
-      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
-      <input type="hidden" name="filters[iiii][type]" value="rating_score"/>
-      {$options.rating_score.name}
-    </span>
-
-    <span class="filter-cond">
-      <select name="filters[iiii][cond]">
-        {html_options options=$options.rating_score.options}
-      </select>
-    </span>
-
-    <span class="filter-value">
-      <input type="text" name="filters[iiii][value]" size="5"/>
-    </span>
-  </li>
-  </div>
-
-  <!-- level -->
-  <div id="filter_level">
-  <li id="filter_iiii" class="filter_level">
-    <span class="filter-title">
-      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
-      <input type="hidden" name="filters[iiii][type]" value="level"/>
-      {$options.level.name}
-    </span>
-
-    <input type="hidden" name="filters[iiii][cond]" value="level"/>
-
-    <span class="filter-value">
-      <select name="filters[iiii][value]">
-        {html_options options=$level_options}
-      </select>
-    </span>
-  </li>
-  </div>
-
-  <!-- limit -->
-  <div id="filter_limit">
-  <li id="filter_iiii" class="filter_limit">
-    <span class="filter-title">
-      <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
-      <input type="hidden" name="filters[iiii][type]" value="limit"/>
-      {$options.limit.name}
-    </span>
-
-    <input type="hidden" name="filters[iiii][cond]" value="limit"/>
-
-    <span class="filter-value">
-      <input type="text" name="filters[iiii][value]" size="5"/>
-    </span>
-  </li>
-  </div>
+  {include file=$SMART_ABS_PATH|cat:'admin/template/filters.inc.tpl'}
 </div>
Index: /extensions/SmartAlbums/admin/template/filters.inc.tpl
===================================================================
--- /extensions/SmartAlbums/admin/template/filters.inc.tpl	(revision 26725)
+++ /extensions/SmartAlbums/admin/template/filters.inc.tpl	(revision 26725)
@@ -0,0 +1,238 @@
+<!-- tags -->
+<div id="filter_tags">
+<li id="filter_iiii" class="filter_tags">
+  <span class="filter-title">
+    <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
+    <input type="hidden" name="filters[iiii][type]" value="tags"/>
+    {$options.tags.name}
+  </span>
+
+  <span class="filter-cond">
+    <select name="filters[iiii][cond]">
+      {html_options options=$options.tags.options}
+    </select>
+  </span>
+
+  <span class="filter-value">
+    <select name="filters[iiii][value]" class="tagSelect">
+    </select>
+  </span>
+</li>
+</div>
+
+<!-- date -->
+<div id="filter_date">
+<li id="filter_iiii" class="filter_date">
+  <span class="filter-title">
+    <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
+    <input type="hidden" name="filters[iiii][type]" value="date"/>
+    {$options.date.name}
+  </span>
+
+  <span class="filter-cond">
+    <select name="filters[iiii][cond]">
+      {html_options options=$options.date.options}
+    </select>
+  </span>
+
+  <span class="filter-value">
+    <input type="text" name="filters[iiii][value]" size="30"/>
+  </span>
+</li>
+</div>
+
+<!-- name -->
+<div id="filter_name">
+<li id="filter_iiii" class="filter_name">
+  <span class="filter-title">
+    <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
+    <input type="hidden" name="filters[iiii][type]" value="name"/>
+    {$options.name.name}
+  </span>
+
+  <span class="filter-cond">
+    <select name="filters[iiii][cond]">
+      {html_options options=$options.name.options}
+    </select>
+  </span>
+
+  <span class="filter-value">
+    <input type="text" name="filters[iiii][value]" size="30"/>
+  </span>
+</li>
+</div>
+
+<!-- album -->
+<div id="filter_album">
+<li id="filter_iiii" class="filter_album">
+  <span class="filter-title">
+    <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
+    <input type="hidden" name="filters[iiii][type]" value="album"/>
+    {$options.album.name}
+  </span>
+
+  <span class="filter-cond">
+    <select name="filters[iiii][cond]">
+      {html_options options=$options.album.options}
+    </select>
+  </span>
+
+  <span class="filter-value">
+    <select name="filters[iiii][value][]" class="albumSelect" multiple="multiple" data-placeholder="{'Select albums...'|translate}">
+      {html_options options=$all_albums}
+    </select>
+  </span>
+</li>
+</div>
+
+<!-- dimensions -->
+<div id="filter_dimensions">
+<li id="filter_iiii" class="filter_dimensions">
+  <span class="filter-title">
+    <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
+    <input type="hidden" name="filters[iiii][type]" value="dimensions"/>
+    {$options.dimensions.name}
+  </span>
+
+  <span class="filter-cond">
+    <select name="filters[iiii][cond]">
+      {html_options options=$options.dimensions.options}
+    </select>
+  </span>
+
+  <span class="filter-value">
+    <span class="dimension_width">
+      <span class="filter_dimension_info"></span>
+        | <a class="dimensions-choice" data-type="width" data-min="{$dimensions.bounds.min_width}" data-max="{$dimensions.bounds.max_width}">{'Reset'|translate}</a>
+        <div class="filter_dimension_width_slider"></div>
+    </span>
+
+    <span class="dimension_height">
+      <span class="filter_dimension_info"></span>
+        | <a class="dimensions-choice" data-type="height" data-min="{$dimensions.bounds.min_height}" data-max="{$dimensions.bounds.max_height}">{'Reset'|translate}</a>
+        <div class="filter_dimension_height_slider"></div>
+    </span>
+
+    <span class="dimension_ratio">
+      <span class="filter_dimension_info"></span>
+      {if isset($dimensions.ratio_portrait)}
+        | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_portrait.min}" data-max="{$dimensions.ratio_portrait.max}">{'Portrait'|translate}</a>
+      {/if}
+      {if isset($dimensions.ratio_square)}
+        | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_square.min}" data-max="{$dimensions.ratio_square.max}">{'square'|translate}</a>
+      {/if}
+      {if isset($dimensions.ratio_landscape)}
+        | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_landscape.min}" data-max="{$dimensions.ratio_landscape.max}">{'Landscape'|translate}</a>
+      {/if}
+      {if isset($dimensions.ratio_panorama)}
+        | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.ratio_panorama.min}" data-max="{$dimensions.ratio_panorama.max}">{'Panorama'|translate}</a>
+      {/if}
+        | <a class="dimensions-choice" data-type="ratio" data-min="{$dimensions.bounds.min_ratio}" data-max="{$dimensions.bounds.max_ratio}">{'Reset'|translate}</a>
+        <div class="filter_dimension_ratio_slider"></div>
+    </span>
+  </span>
+
+  <input type="hidden" name="filters[iiii][value][min]" value="">
+  <input type="hidden" name="filters[iiii][value][max]" value="">
+</li>
+</div>
+
+<!-- author -->
+<div id="filter_author">
+<li id="filter_iiii" class="filter_author">
+  <span class="filter-title">
+    <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
+    <input type="hidden" name="filters[iiii][type]" value="author"/>
+    {$options.author.name}
+  </span>
+
+  <span class="filter-cond">
+    <select name="filters[iiii][cond]">
+      {html_options options=$options.author.options}
+    </select>
+  </span>
+
+  <span class="filter-value">
+    <input type="text" name="filters[iiii][value]" size="30"/>
+    <i>{'For "Is (not) in", separate each author by a comma'|translate}</i>
+  </span>
+</li>
+</div>
+
+<!-- hit -->
+<div id="filter_hit">
+<li id="filter_iiii" class="filter_hit">
+  <span class="filter-title">
+    <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
+    <input type="hidden" name="filters[iiii][type]" value="hit"/>
+    {$options.hit.name}
+  </span>
+
+  <span class="filter-cond">
+    <select name="filters[iiii][cond]">
+      {html_options options=$options.hit.options}
+    </select>
+  </span>
+
+  <span class="filter-value">
+    <input type="text" name="filters[iiii][value]" size="5"/>
+  </span>
+</li>
+</div>
+
+<!-- rating_score -->
+<div id="filter_rating_score">
+<li id="filter_iiii" class="filter_rating_score">
+  <span class="filter-title">
+    <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
+    <input type="hidden" name="filters[iiii][type]" value="rating_score"/>
+    {$options.rating_score.name}
+  </span>
+
+  <span class="filter-cond">
+    <select name="filters[iiii][cond]">
+      {html_options options=$options.rating_score.options}
+    </select>
+  </span>
+
+  <span class="filter-value">
+    <input type="text" name="filters[iiii][value]" size="5"/>
+  </span>
+</li>
+</div>
+
+<!-- level -->
+<div id="filter_level">
+<li id="filter_iiii" class="filter_level">
+  <span class="filter-title">
+    <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
+    <input type="hidden" name="filters[iiii][type]" value="level"/>
+    {$options.level.name}
+  </span>
+
+  <input type="hidden" name="filters[iiii][cond]" value="level"/>
+
+  <span class="filter-value">
+    <select name="filters[iiii][value]">
+      {html_options options=$level_options}
+    </select>
+  </span>
+</li>
+</div>
+
+<!-- limit -->
+<div id="filter_limit">
+<li id="filter_iiii" class="filter_limit">
+  <span class="filter-title">
+    <a href="#" class="removeFilter" title="{'remove this filter'|translate}"><span>[x]</span></a>
+    <input type="hidden" name="filters[iiii][type]" value="limit"/>
+    {$options.limit.name}
+  </span>
+
+  <input type="hidden" name="filters[iiii][cond]" value="limit"/>
+
+  <span class="filter-value">
+    <input type="text" name="filters[iiii][value]" size="5"/>
+  </span>
+</li>
+</div>
