mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
issue #2001 make sure TAGS tpl variable is always set
This commit is contained in:
@@ -201,6 +201,7 @@ if ( empty($page['is_external']) )
|
||||
|
||||
if (isset($my_search['fields']['tags']))
|
||||
{
|
||||
$filter_tags = $filter_tag_ids = array();
|
||||
// TODO calling get_available_tags(), with lots of photos/albums/tags may cost time,
|
||||
// we should reuse the result if already executed (for building the menu for example)
|
||||
if (isset($search_items))
|
||||
@@ -213,18 +214,16 @@ if ( empty($page['is_external']) )
|
||||
usort($filter_tags, 'tag_alpha_compare');
|
||||
}
|
||||
|
||||
$filter_tag_ids = array();
|
||||
|
||||
if (count($filter_tags) > 0)
|
||||
{
|
||||
$template->assign('TAGS', $filter_tags);
|
||||
|
||||
foreach ($filter_tags as $tag)
|
||||
{
|
||||
$filter_tag_ids[] = $tag['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('TAGS', $filter_tags);
|
||||
|
||||
// in case the search has forbidden tags for current user, we need to filter the search rule
|
||||
$my_search['fields']['tags']['words'] = array_intersect($my_search['fields']['tags']['words'], $filter_tag_ids);
|
||||
}
|
||||
|
||||
@@ -133,6 +133,7 @@ str_empty_search_bot_alt = "{'Pre-established filters are proposed, but you can
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{if isset($TAGS)}
|
||||
<div class="filter filter-tag">
|
||||
<span class="mcs-icon pwg-icon-tag filter-icon"></span>
|
||||
<span class="search-words"></span>
|
||||
@@ -167,6 +168,7 @@ str_empty_search_bot_alt = "{'Pre-established filters are proposed, but you can
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($DATE_POSTED)}
|
||||
<div class="filter filter-date_posted">
|
||||
|
||||
Reference in New Issue
Block a user