projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Typo in GuV Gruppenüberschrift
[kivitendo-erp.git]
/
SL
/
Menu.pm
diff --git
a/SL/Menu.pm
b/SL/Menu.pm
index
48ac622
..
06ea6ee
100644
(file)
--- a/
SL/Menu.pm
+++ b/
SL/Menu.pm
@@
-42,14
+42,19
@@
use strict;
sub new {
$main::lxdebug->enter_sub();
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();
$self->set_access();
@@
-59,7
+64,7
@@
sub new {
}
sub menuitem_new {
}
sub menuitem_new {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(
LXDebug::DEBUG2()
);
my ($self, $name, $item) = @_;
my ($self, $name, $item) = @_;
@@
-84,7
+89,7
@@
sub menuitem_new {
$item->{href} .= "&" . $form->escape($key) . "=" . $form->escape($value);
}
$item->{href} .= "&" . $form->escape($key) . "=" . $form->escape($value);
}
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(
LXDebug::DEBUG2()
);
}
sub access_control {
}
sub access_control {
@@
-94,7
+99,7
@@
sub access_control {
my @menu = ();
my @menu = ();
- if (
$menulevel eq ""
) {
+ if (
!$menulevel
) {
@menu = grep { !/--/ } @{ $self->{ORDER} };
} else {
@menu = grep { /^${menulevel}--/ } @{ $self->{ORDER} };
@menu = grep { !/--/ } @{ $self->{ORDER} };
} else {
@menu = grep { /^${menulevel}--/ } @{ $self->{ORDER} };