From: Sven Schöling Date: Thu, 29 Sep 2016 11:59:42 +0000 (+0200) Subject: Menu: links für Menü cachen X-Git-Tag: release-3.5.4~1420 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=02497699124fa6a3bd1a76104a3c39a5131ab981;p=kivitendo-erp.git Menu: links für Menü cachen --- diff --git a/SL/Menu.pm b/SL/Menu.pm index 08727ce36..b91611242 100644 --- a/SL/Menu.pm +++ b/SL/Menu.pm @@ -212,14 +212,16 @@ sub href_for_node { return undef if !$node->{href} && !$node->{module} && !$node->{params}; - my $href = $node->{href} || $node->{module} || 'controller.pl'; - my @tokens; + return $node->{href_for_node} ||= do { + my $href = $node->{href} || $node->{module} || 'controller.pl'; + my @tokens; - while (my ($key, $value) = each %{ $node->{params} }) { - push @tokens, uri_encode($key, 1) . "=" . uri_encode($value, 1); - } + while (my ($key, $value) = each %{ $node->{params} }) { + push @tokens, uri_encode($key, 1) . "=" . uri_encode($value, 1); + } - return join '?', $href, grep $_, join '&', @tokens; + join '?', $href, grep $_, join '&', @tokens; + } } sub name_for_node {