diff options
author | plegall <plg@piwigo.org> | 2006-05-15 22:19:48 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2006-05-15 22:19:48 +0000 |
commit | 357f1d842d7a5f937fe0d0479566401bb6e360de (patch) | |
tree | 23afd091f441221313327938d496b67ab65e15a9 /search.php | |
parent | 49682c913aec3855e576841dbfe18cba5ee2acfc (diff) |
bug 373 fixed: if there is no tag defined, an explicit message is displayed
in the administration section. In the public search screen, tag fieldset is
not displayed if no reachable tag.
git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1313 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | search.php | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/search.php b/search.php index 0701eafa1..5131680d6 100644 --- a/search.php +++ b/search.php @@ -177,28 +177,39 @@ include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames( array('search'=>'search.tpl') ); +$template->assign_vars( + array( + 'TODAY_DAY' => date('d', time()), + 'TODAY_MONTH' => date('m', time()), + 'TODAY_YEAR' => date('Y', time()), + 'S_SEARCH_ACTION' => 'search.php', + 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=search', + 'U_HOME' => make_index_url(), + ) + ); + $available_tags = get_available_tags( isset($user['forbidden_categories']) ? explode(',', $user['forbidden_categories']) : null ); -usort( $available_tags, 'name_compare'); - -$template->assign_vars(array( - 'TODAY_DAY' => date('d', time()), - 'TODAY_MONTH' => date('m', time()), - 'TODAY_YEAR' => date('Y', time()), - 'S_SEARCH_ACTION' => 'search.php', - 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=search', - 'U_HOME' => make_index_url(), - - 'TAG_SELECTION' => get_html_tag_selection( - $available_tags, - 'tags', - isset($_POST['tags']) ? $_POST['tags'] : array() - ), - ) -); + +if (count($available_tags) > 0) +{ + usort( $available_tags, 'name_compare'); + + $template->assign_block_vars('tags', array()); + + $template->assign_vars( + array( + 'TAG_SELECTION' => get_html_tag_selection( + $available_tags, + 'tags', + isset($_POST['tags']) ? $_POST['tags'] : array() + ), + ) + ); +} //------------------------------------------------------------- categories form $query = ' |