-use SL::Auth;
-use SL::Inifile;
-
-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 menuitem {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form, $item) = @_;
-
- my $module = $form->{script};
- my $action = "section_menu";
- my $target = "";
-
- if ($self->{$item}{module}) {
- $module = $self->{$item}{module};
- }
- if ($self->{$item}{action}) {
- $action = $self->{$item}{action};
- }
- if ($self->{$item}{target}) {
- $target = $self->{$item}{target};
- }
-
- my $level = $form->escape($item);
-
- my $str = qq|<a style="vertical-align:top" href=$module?action=$action&level=$level|;
-
- my @vars = qw(module action target href);
-
- if ($self->{$item}{href}) {
- $str = qq|<a href=$self->{$item}{href}|;
- @vars = qw(module target href);
- }
-
- map { delete $self->{$item}{$_} } @vars;
-
- # add other params
- foreach my $key (keys %{ $self->{$item} }) {
- $str .= "&" . $form->escape($key, 1) . "=";
- ($value, $conf) = split(/=/, $self->{$item}{$key}, 2);
- $value = $myconfig->{$value} . "/$conf" if ($conf);
- $str .= $form->escape($value, 1);
- }
-
- if ($target) {
- $str .= qq| target=$target|;
- }
-
- $str .= ">";
-
- $main::lxdebug->leave_sub();
-
- return $str;
-}