X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FLayout%2FCssMenu.pm;h=6897a478c324b32d1e2affc8311b0ecc237cfd1c;hb=e3dfdb7a78f6e0bc8ac1075fedc36f8247c6fd92;hp=c26fad7bb8d80eb2d5a6423ab08b9ef5c7714202;hpb=68dbf4a4cb26b9554a23f076438109d7fc2d861c;p=kivitendo-erp.git
diff --git a/SL/Layout/CssMenu.pm b/SL/Layout/CssMenu.pm
index c26fad7bb..6897a478c 100644
--- a/SL/Layout/CssMenu.pm
+++ b/SL/Layout/CssMenu.pm
@@ -3,114 +3,12 @@ package SL::Layout::CssMenu;
use strict;
use parent qw(SL::Layout::Base);
-use URI;
-
-sub print_menu {
- my ($self, $parent, $depth) = @_;
-
- my $html;
-
- die if ($depth * 1 > 5);
-
- my @menuorder;
- my $menu = $self->menu;
-
- @menuorder = $menu->access_control(\%::myconfig, $parent);
-
- $parent .= "--" if ($parent);
-
- foreach my $item (@menuorder) {
- substr($item, 0, length($parent)) = "";
- next if (($item eq "") || ($item =~ /--/));
-
- my $menu_item = $menu->{"${parent}${item}"};
- my $menu_title = $::locale->text($item);
- my $menu_text = $menu_title;
-
- if ($menu_item->{"submenu"} || !defined($menu_item->{"module"}) && !defined($menu_item->{href})) {
-
- my $h = $self->print_menu("${parent}${item}", $depth * 1 + 1)."\n";
- if (!$parent) {
- $html .= qq|
\n|;
- } else {
- $html .= qq|${menu_text}
\n|;
- }
- } else {
- if ($self->{sub_class} && $depth > 1) {
- $html .= qq||;
- } else {
- $html .= qq||;
- }
- $html .= $self->menuitem_v3("${parent}$item", { "title" => $menu_title });
- $html .= qq|${menu_text}\n|;
- }
- }
-
- return $html;
-}
-
-sub menuitem_v3 {
- $main::lxdebug->enter_sub();
-
- my ($self, $item, $other) = @_;
- my $menuitem = $self->menu->{$item};
-
- my $action = "section_menu";
- my $module;
-
- if ($menuitem->{module}) {
- $module = $menuitem->{module};
- }
- if ($menuitem->{action}) {
- $action = $menuitem->{action};
- }
-
- my $level = $::form->escape($item);
-
- my @vars;
- my $target = $menuitem->{target} ? qq| target="| . $::form->escape($menuitem->{target}) . '"' : '';
- my $str = qq|';
- }
-
- $str .= qq|$module?action=| . $::form->escape($action);
-
- map { delete $menuitem->{$_} } qw(module action target href);
-
- # add other params
- foreach my $key (keys %{ $menuitem }) {
- $str .= "&" . $::form->escape($key, 1) . "=";
- my ($value, $conf) = split(/=/, $menuitem->{$key}, 2);
- $value = $::myconfig{$value} . "/$conf" if ($conf);
- $str .= $::form->escape($value, 1);
- }
-
- $str .= '"';
-
- if ($other) {
- foreach my $key (keys(%{$other})) {
- $str .= qq| ${key}="| . $::form->quote($other->{$key}) . qq|"|;
- }
- }
-
- $str .= ">";
-
- $main::lxdebug->leave_sub();
-
- return $str;
-}
-
-sub use_stylesheet {
- qw(icons16.css frame_header/header.css),
+sub static_stylesheets {
+ qw(icons16.css),
}
sub pre_content {
- $_[0]->presenter->render('menu/menuv3',
- menu => $_[0]->print_menu,
- );
+ $_[0]->presenter->render('menu/menuv3', menu => $_[0]->menu);
}
1;