Allows for configuration of an always-on global search filter. All
searches, regardless of origin, in the kpac will be appended by this
filter when configured.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
<kpac version="1.0" xmlns="http://evergreen-ils.org/spec/OPAC/kpac/v1">
+
+ <!--
+ If configured, all searches, including topic searches configured
+ below, will be appended with this filter. The purpose is to restrict
+ all searches within the kpac to a specific collection.
+
+ <global_filter>audience(a,b,c,d,j)</global_filter>
+ -->
+
<pages>
<!-- top-level layout pages -->
<page id="1" columns="5" name="Home" img="/images/home.jpg">
my $query = _prepare_biblio_search_basics($cgi) || '';
+ $query .= ' ' . $ctx->{global_search_filter} if $ctx->{global_search_filter};
+
foreach ($cgi->param('modifier')) {
# The unless bit is to avoid stacking modifiers.
$query = ('#' . $_ . ' ' . $query) unless $query =~ qr/\#\Q$_/;
$ctx->{kpac_config} = $kpac_config;
$ctx->{kpac_root} = $ctx->{base_path} . "/kpac";
$ctx->{home_page} = 'http://' . $self->apache->hostname . $ctx->{kpac_root} . "/home";
+ $ctx->{global_search_filter} = $kpac_config->{global_filter};
}