{** * templates/frontend/components/searchFilter.tpl * * Copyright (c) 2014-2018 Simon Fraser University * Copyright (c) 2003-2018 John Willinsky * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. * * @brief View of a filter (active or inactive) used on the search page. * @todo The search filter component needs a pretty heavy rewrite along with the * search.tpl page template. This template includes far too much logic which * could be processed in SearchHandler.inc.php. * * @uses $filterType string Can be "date" or "text" (default: text) * @uses $filterName string * @uses $filterValue string * @uses $key string The translation key for the field name. * @uses $displayIf string Can be "emptyFilter" or "activeFilter". * @uses $startYear string Required for filter type "date". * @uses $endYear string Required for filter type "date". *} {if empty($filterValue) || ($filterType == "date" && $filterValue == "--")} {assign var="isEmptyFilter" value=1} {else} {assign var="isEmptyFilter" value=0} {/if} {if ($displayIf == "emptyFilter" && $isEmptyFilter) || ($displayIf == "activeFilter" && !$isEmptyFilter)}