aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2014-06-16 14:17:53 +0000
committerplegall <plg@piwigo.org>2014-06-16 14:17:53 +0000
commit583af81d3d23ab0e3692dd7bb4a36314deab5994 (patch)
tree9adcf050648d45181cc00eecb95fcd40c211081a
parent0511ed2236b1fab9bc9c23b6c3bbee82ee4efdb5 (diff)
feature 2563: do not display all tags as checkboxes on search.php. Use jQuery Selectize instead.
git-svn-id: http://piwigo.org/svn/trunk@28708 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--search.php9
-rw-r--r--themes/default/template/search.tpl14
2 files changed, 11 insertions, 12 deletions
diff --git a/search.php b/search.php
index 2846d52ed..247430fde 100644
--- a/search.php
+++ b/search.php
@@ -204,14 +204,7 @@ if (count($available_tags) > 0)
{
usort( $available_tags, 'tag_alpha_compare');
- $template->assign(
- 'TAG_SELECTION',
- get_html_tag_selection(
- $available_tags,
- 'tags',
- isset($_POST['tags']) ? $_POST['tags'] : array()
- )
- );
+ $template->assign('TAGS', $available_tags);
}
// authors
diff --git a/themes/default/template/search.tpl b/themes/default/template/search.tpl
index 09257ef96..34b8f3625 100644
--- a/themes/default/template/search.tpl
+++ b/themes/default/template/search.tpl
@@ -8,7 +8,7 @@
{footer_script}
jQuery(document).ready(function() {
- jQuery("#authors").selectize({
+ jQuery("#authors, #tags").selectize({
plugins: ['remove_button']
});
});
@@ -46,16 +46,22 @@ jQuery(document).ready(function() {
<label>{'Search for Author'|@translate}
<select id="authors" placeholder="{'Type in a search term'|translate}" name="authors[]" multiple style="width:500px;">
{foreach from=$AUTHORS item=author}
- <option value="{$author.author|strip_tags:false|escape:html}">{$author.author|strip_tags:false} ({'%d photos'|translate:$author.counter})</option>
+ <option value="{$author.author|strip_tags:false|escape:html}">{$author.author|strip_tags:false} ({$author.counter|translate_dec:'%d photo':'%d photos'})</option>
{/foreach}
</select>
</label>
</fieldset>
-{if isset($TAG_SELECTION)}
+{if isset($TAGS)}
<fieldset>
<legend>{'Search tags'|@translate}</legend>
- {$TAG_SELECTION}
+
+ <select id="tags" placeholder="{'Type in a search term'|translate}" name="tags[]" multiple style="width:500px;">
+{foreach from=$TAGS item=tag}
+ <option value="{$tag.id}">{$tag.name} ({$tag.counter|translate_dec:'%d photo':'%d photos'})</option>
+{/foreach}
+ </select>
+
<label><span><input type="radio" name="tag_mode" value="AND" checked="checked"> {'All tags'|@translate}</span></label>
<label><span><input type="radio" name="tag_mode" value="OR"> {'Any tag'|@translate}</span></label>
</fieldset>