From: Holger Lindemann Date: Tue, 10 Feb 2009 14:49:25 +0000 (+0000) Subject: altes JS-Menu wieder aktiviert - ist nicht schön, aber funktioniert besser X-Git-Tag: release-2.6.0beta2~176 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=473686a9a1988e577084eed734e307e3aa97075e;p=kivitendo-erp.git altes JS-Menu wieder aktiviert - ist nicht schön, aber funktioniert besser --- 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();