From 63a8dae2dc231828b3d29d082b25acf317f26f9b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 16 Jul 2013 13:31:51 +0200 Subject: [PATCH] =?utf8?q?CRM-Men=C3=BC=20automatisch=20einlesen,=20falls?= =?utf8?q?=20es=20existiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Siehe #2328. --- SL/Layout/Base.pm | 2 +- SL/Menu.pm | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/SL/Layout/Base.pm b/SL/Layout/Base.pm index 2212f718e..467f56ee8 100644 --- a/SL/Layout/Base.pm +++ b/SL/Layout/Base.pm @@ -29,7 +29,7 @@ sub new { } sub init_menu { - Menu->new('menu.ini'); + Menu->new('crm/update/menu.ini', 'menu.ini'); } sub init_auto_reload_resources_param { diff --git a/SL/Menu.pm b/SL/Menu.pm index 0fb1b1a95..06ea6ee43 100644 --- a/SL/Menu.pm +++ b/SL/Menu.pm @@ -42,14 +42,19 @@ use strict; sub new { $main::lxdebug->enter_sub(); - my ($type, $menufile) = @_; + my ($type, @menufiles) = @_; + my $self = bless {}, $type; - my $self = {}; - my $inifile = Inifile->new($menufile); + my @order; - map { $self->{$_} = $inifile->{$_} } keys %{ $inifile }; + foreach my $menufile (grep { -f } @menufiles) { + my $inifile = Inifile->new($menufile); - bless $self, $type; + push @order, @{ delete($inifile->{ORDER}) || [] }; + $self->{$_} = $inifile->{$_} for keys %{ $inifile }; + } + + $self->{ORDER} = \@order; $self->set_access(); -- 2.20.1