-sub new {
- $main::lxdebug->enter_sub();
-
- my ($type, $menufile) = @_;
-
- my $self = {};
- my $inifile = Inifile->new($menufile);
-
- map { $self->{$_} = $inifile->{$_} } keys %{ $inifile };
-
- bless $self, $type;
-
- $self->set_access();
-
- $main::lxdebug->leave_sub();
-
- return $self;
-}
-
-sub menuitems {
- my ($self) = @_;
-
- map {
- SL::MenuItem->new(
- name => $_,
- menu => $self,
- item => $self->{$_}
- );
- } $self->access_control;
-}
-
-sub menuitem {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form, $item) = @_;
-
- my $module = $self->{$item}{module} || $form->{script};
- my $action = $self->{$item}{action} || "section_menu";
- my $target = $self->{$item}{target} || "";
- my $level = $form->escape($item);
- my $target_token = ($target) ? "target='$target'" : '';
-
- my $href = ($self->{$item}{href})
- ? $form->escape($self->{$item}{href})
- : "$module?action=$action";
-
- # add other params
- foreach my $key (keys %{ $self->{$item} }) {
- next if $key =~ /target|module|action/;
- $href .= "&" . $form->escape($key, 1) . "=";
- my ($value, $conf) = split(/=/, $self->{$item}{$key}, 2);
- $value = $myconfig->{$value} . "/$conf" if ($conf);
- $href .= $form->escape($value, 1);
- }
-
- my $str = "<a href='$href' $target_token>";
-
- $main::lxdebug->leave_sub();
-
- return $str;
-}
-
-sub menuitem_js {
- my ($self, $myconfig, $form, $item) = @_;
-
- my $module = $form->{script};
- my $action = "section_menu";