From 8660390cf291a037ce540f0c3372e6f213938e50 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 28 Dec 2012 14:06:26 +0100 Subject: [PATCH] =?utf8?q?Men=C3=BCs:=20"target=3D..."=20wieder=20unterst?= =?utf8?q?=C3=BCtzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Layout/MenuLeft.pm | 6 +++--- SL/Layout/V3.pm | 16 +++++++++------- templates/webpages/menu/menu.html | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/SL/Layout/MenuLeft.pm b/SL/Layout/MenuLeft.pm index 2f260c935..c0e937ab8 100644 --- a/SL/Layout/MenuLeft.pm +++ b/SL/Layout/MenuLeft.pm @@ -70,8 +70,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 @@ -83,7 +81,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 { @@ -129,6 +127,8 @@ Each entry is another array with the following fields: 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: diff --git a/SL/Layout/V3.pm b/SL/Layout/V3.pm index 713764f60..a59424001 100644 --- a/SL/Layout/V3.pm +++ b/SL/Layout/V3.pm @@ -87,18 +87,20 @@ sub menuitem_v3 { $action = $menuitem->{action}; } - my $level = $::form->escape($item); + my $level = $::form->escape($item); - my $str = qq|escape($menuitem->{target}) . '"' : ''; + my $str = qq|{href}|; - @vars = qw(module target href); + $main::lxdebug->leave_sub(); + return $str . $menuitem->{href} . '">'; } - map { delete $menuitem->{$_} } @vars; + $str .= qq|$module?action=| . $::form->escape($action) . qq|&level=| . $::form->escape($level); + + map { delete $menuitem->{$_} } qw(module action target href); # add other params foreach my $key (keys %{ $menuitem }) { diff --git a/templates/webpages/menu/menu.html b/templates/webpages/menu/menu.html index 385ad8105..f75035ab9 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[3])),$('').append(b[0]));if(b[5])a.attr('href', b[5]);$('#html-menu').append($('