use OpenILS::Application::AppUtils;
use OpenILS::Utils::CStoreEditor qw/:funcs/;
my $U = 'OpenILS::Application::AppUtils';
-my $kpac_config;
+my %kpac_config;
# -----------------------------------------------------------------------------
# Override our parent's load() sub so we can do kpac-specific path routing.
$self->apache->log->error("KPacConfigFile required!");
return;
}
+
+ if (!$kpac_config{$path}) {
- $kpac_config = XMLin(
- $path,
- KeyAttr => ['id'],
- ForceArray => ['layout', 'page', 'cell'],
- NormaliseSpace => 2
- );
+ $kpac_config{$path} = XMLin(
+ $path,
+ KeyAttr => ['id'],
+ ForceArray => ['layout', 'page', 'cell'],
+ NormaliseSpace => 2
+ );
+ }
my $ou = $ctx->{physical_loc} || $self->_get_search_lib;
my $layout;
# Search up the org tree to find the nearest config for the context org unit
while (my $org = $ctx->{get_aou}->($ou)) {
- ($layout) = grep {$_->{owner} eq $org->id} @{$kpac_config->{layout}};
+ ($layout) = grep {$_->{owner} eq $org->id} @{$kpac_config{$path}->{layout}};
last if $layout;
$ou = $org->parent_ou;
}
$ctx->{kpac_layout} = $layout;
- $ctx->{kpac_config} = $kpac_config;
+ $ctx->{kpac_config} = $kpac_config{$path};
$ctx->{kpac_root} = $ctx->{base_path} . "/kpac";
$ctx->{home_page} = $ctx->{proto} . '://' . $ctx->{hostname} . $ctx->{kpac_root} . "/home";
- $ctx->{global_search_filter} = $kpac_config->{global_filter};
+ $ctx->{global_search_filter} = $kpac_config{$path}->{global_filter};
}