X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FLayout%2FMenuLeft.pm;h=f2e8a053fa197c6fde30c3da5dca5784fe8a9a2b;hb=4bb9bf41d5f989445548e788c87699d27d8774da;hp=a171ed184beb309ac8a645cf7bbd4765ce093e0a;hpb=b6fd15a8dc44f9b09d5a2bce766cda14b87c6e13;p=kivitendo-erp.git diff --git a/SL/Layout/MenuLeft.pm b/SL/Layout/MenuLeft.pm index a171ed184..f2e8a053f 100644 --- a/SL/Layout/MenuLeft.pm +++ b/SL/Layout/MenuLeft.pm @@ -8,17 +8,25 @@ use URI; use List::MoreUtils qw(apply); sub stylesheets { - qw(css/icons16.css css/icons24.css) + qw(icons16.css icons24.css menu.css) } sub javascripts_inline { my $self = shift; + $self->SUPER::javascripts_inline; my $sections = [ section_menu($self->menu) ]; - $self->render('menu/menu', { no_menu => 1, no_output => 1 }, + $self->presenter->render('menu/menu', sections => $sections, ) } +sub javascripts { + qw( + js/jquery.cookie.js + js/switchmenuframe.js + ); +} + sub pre_content { "
\n"; } @@ -43,7 +51,7 @@ sub section_menu { my $menuitem = $menu->{$item}; my $olabel = apply { s/.*--// } $item; my $ml = apply { s/--.*// } $item; - my $icon_class = apply { y/ /-/ } $item; + my $icon_class = apply { $_ =lc $_; s/[^a-z0-9_-]/-/g } $item; my $spacer = "s" . (0 + $item =~ s/--/--/g); next if $level && $item ne "$level--$olabel"; @@ -63,8 +71,6 @@ sub section_menu { $menuitem->{href} .= $::form->escape($value, 1); } - my $anchor = $menuitem->{href}; - my @common_args = ($label, $spacer, "$id_prefix\_$id"); if (!$level) { # toplevel @@ -76,7 +82,7 @@ sub section_menu { #make_image(label => 'submenu'), push @items, section_menu($menu, $item, "$id_prefix\_$id"); } elsif ($menuitem->{module}) { - push @items, [ @common_args, "icon16 $icon_class", 'i', $anchor ]; + push @items, [ @common_args, "icon16 $icon_class", 'i', $menuitem->{href}, $menuitem->{target} ]; #make_image(size => 16, label => $item), } } continue { @@ -103,3 +109,81 @@ sub _show_images { } 1; + +__END__ + +=encoding utf-8 + +=head1 NAME + +SL::Layout::MenuLeft - ex html meanu, now only left menu + +=head1 DOM MODEL + +Data will be embedded into the page as a json array of entries. +Each entry is another array with the following fields: + + 0: title + 1: indentation classes + 2: unique id + 3: icon classes + 4: role classes + 5: href + 6: target + +From each entry the following dom will be generated, with [0] being entry 0 of +the data array: + +