Commit c22966a8 authored by Xavier Guimard's avatar Xavier Guimard

Cache for specific menu app rules (#595)

parent 9895cc2d
......@@ -31,6 +31,8 @@ has menuModules => (
}
);
has specific => ( is => 'rw', default => sub { {} } );
has imgPath => (
is => 'rw',
lazy => 1,
......@@ -419,10 +421,17 @@ sub _filterHash {
next if ( $appdisplay =~ /^(yes|on)$/ );
my $cond = undef;
# If a specific rule exists, get it from cache or compile it
if ( $appdisplay !~ /^auto$/i ) {
$cond =
$self->p->HANDLER->buildSub(
$self->p->HANDLER->substitute($appdisplay) );
if ( $self->specific->{$appuri} ) {
$cond = $self->specific->{$appuri};
}
else {
$cond = $self->specific->{$appuri} =
$self->p->HANDLER->buildSub(
$self->p->HANDLER->substitute($appdisplay) );
}
}
# Check grant function if display is "auto" (this is the default)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment