From 473686a9a1988e577084eed734e307e3aa97075e Mon Sep 17 00:00:00 2001 From: Holger Lindemann Date: Tue, 10 Feb 2009 14:49:25 +0000 Subject: [PATCH] =?utf8?q?altes=20JS-Menu=20wieder=20aktiviert=20-=20ist?= =?utf8?q?=20nicht=20sch=C3=B6n,=20aber=20funktioniert=20besser?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Menu.pm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/SL/Menu.pm b/SL/Menu.pm index 81eedb1a8..4b470cabc 100644 --- a/SL/Menu.pm +++ b/SL/Menu.pm @@ -107,6 +107,44 @@ sub menuitem { return $str; } +sub menuitem_js { + my ($self, $myconfig, $form, $item) = @_; + + my $module = $form->{script}; + my $action = "section_menu"; + + #if ($self->{$item}{module}) { + $module = $self->{$item}{module}; + + #} + if ($self->{$item}{action}) { + $action = $self->{$item}{action}; + } + + my $level = $form->escape($item); + my $str = + qq|$module?action=$action&level=$level&login=$form->{login}&password=$form->{password}|; + my @vars = qw(module action target href); + + if ($self->{$item}{href}) { + $str = qq|$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); + } + + $str .= " "; + +} + sub menuitem_new { $main::lxdebug->enter_sub(); -- 2.20.1