From: Moritz Bunkus Date: Fri, 28 Dec 2012 13:06:26 +0000 (+0100) Subject: Menüs: "target=..." wieder unterstützt X-Git-Tag: release-3.1.0beta1~764 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8660390cf291a037ce540f0c3372e6f213938e50;p=kivitendo-erp.git Menüs: "target=..." wieder unterstützt --- 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($('