From 6fd839ca475e7bc845eeff171acf670c996ae3f9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 14 Sep 2012 19:03:03 +0200 Subject: [PATCH] menu auf arrays umgestellt --- SL/Controller/Layout/MenuLeft.pm | 33 +++++++------------------------ templates/webpages/menu/menu.html | 2 +- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/SL/Controller/Layout/MenuLeft.pm b/SL/Controller/Layout/MenuLeft.pm index 9aa230fec..75c99e3b1 100644 --- a/SL/Controller/Layout/MenuLeft.pm +++ b/SL/Controller/Layout/MenuLeft.pm @@ -7,14 +7,6 @@ use URI; use List::MoreUtils qw(apply); -sub new { - my ($class, @slurp) = @_; - - my $self = $class->SUPER::new(@slurp); - - $self; -} - sub stylesheets { qw(css/icons16.css css/icons24.css) } @@ -73,30 +65,19 @@ sub section_menu { my $anchor = $menuitem->{href}; - my %common_args = ( - l => $label, - s => $spacer, - id => "$id_prefix\_$id", - ); + my @common_args = ($label, $spacer, "$id_prefix\_$id"); if (!$level) { # toplevel - push @items, { %common_args, - i => "icon24 $icon_class", # make_image(size => 24, label => $item), - c => 'm', - }; + push @items, [ @common_args, "icon24 $icon_class", 'm' ]; + # make_image(size => 24, label => $item), push @items, section_menu($menu, $item, "$id_prefix\_$id"); } elsif ($menuitem->{submenu}) { - push @items, { %common_args, - i => "icon16 submenu", #make_image(label => 'submenu'), - c => 'sm', - }; + push @items, [ @common_args, "icon16 submenu", 'sm' ]; + #make_image(label => 'submenu'), push @items, section_menu($menu, $item, "$id_prefix\_$id"); } elsif ($menuitem->{module}) { - push @items, { %common_args, - i => "icon16 $icon_class", #make_image(size => 16, label => $item), - h => $anchor, - c => 'i', - }; + push @items, [ @common_args, "icon16 $icon_class", 'i', $anchor ]; + #make_image(size => 16, label => $item), } } continue { $id++; diff --git a/templates/webpages/menu/menu.html b/templates/webpages/menu/menu.html index ef9aa211d..385ad8105 100644 --- a/templates/webpages/menu/menu.html +++ b/templates/webpages/menu/menu.html @@ -1,2 +1,2 @@ [%- USE JSON %] -$(function(){$([% JSON.json(sections) %]).each(function(i,b){var a=$('').append($('').append($('
').addClass(b.i)),$('').append(b.l));if(b.h)a.attr('href', b.h);if(b.t)a.attr('target', b.t);$('#html-menu').append($('