From: Moritz Bunkus Date: Tue, 16 Jul 2013 11:31:51 +0000 (+0200) Subject: CRM-MenĂ¼ automatisch einlesen, falls es existiert X-Git-Tag: release-3.1.0beta1~161^2^2~43 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c617a444526ae87cca99936a613ceb6ded70ba6e;p=kivitendo-erp.git CRM-MenĂ¼ automatisch einlesen, falls es existiert Siehe #2328. --- 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();