mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02: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']))
|
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,
|
// 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)
|
// we should reuse the result if already executed (for building the menu for example)
|
||||||
if (isset($search_items))
|
if (isset($search_items))
|
||||||
@@ -213,18 +214,16 @@ if ( empty($page['is_external']) )
|
|||||||
usort($filter_tags, 'tag_alpha_compare');
|
usort($filter_tags, 'tag_alpha_compare');
|
||||||
}
|
}
|
||||||
|
|
||||||
$filter_tag_ids = array();
|
|
||||||
|
|
||||||
if (count($filter_tags) > 0)
|
if (count($filter_tags) > 0)
|
||||||
{
|
{
|
||||||
$template->assign('TAGS', $filter_tags);
|
|
||||||
|
|
||||||
foreach ($filter_tags as $tag)
|
foreach ($filter_tags as $tag)
|
||||||
{
|
{
|
||||||
$filter_tag_ids[] = $tag['id'];
|
$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
|
// 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);
|
$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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{if isset($TAGS)}
|
||||||
<div class="filter filter-tag">
|
<div class="filter filter-tag">
|
||||||
<span class="mcs-icon pwg-icon-tag filter-icon"></span>
|
<span class="mcs-icon pwg-icon-tag filter-icon"></span>
|
||||||
<span class="search-words"></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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
{if isset($DATE_POSTED)}
|
{if isset($DATE_POSTED)}
|
||||||
<div class="filter filter-date_posted">
|
<div class="filter filter-date_posted">
|
||||||
|
|||||||
Reference in New Issue
Block a user