$menuitem->{href} .= $::form->escape($value, 1);
}
- my $anchor = $menuitem->{href};
-
my @common_args = ($label, $spacer, "$id_prefix\_$id");
if (!$level) { # toplevel
#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 {
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:
$action = $menuitem->{action};
}
- my $level = $::form->escape($item);
+ my $level = $::form->escape($item);
- my $str = qq|<a href="$module?action=| . $::form->escape($action) . qq|&level=| . $::form->escape($level);
-
- my @vars = qw(module action target href);
+ my @vars;
+ my $target = $menuitem->{target} ? qq| target="| . $::form->escape($menuitem->{target}) . '"' : '';
+ my $str = qq|<a${target} href="|;
if ($menuitem->{href}) {
- $str = qq|<a href="$menuitem->{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 }) {
[%- USE JSON %]
-$(function(){$([% JSON.json(sections) %]).each(function(i,b){var a=$('<a class="ml">').append($('<span class="mii ms">').append($('<div>').addClass(b[3])),$('<span class="mic">').append(b[0]));if(b[5])a.attr('href', b[5]);$('#html-menu').append($('<div class="mi">').addClass(b[4]).addClass(b[1]).attr('id','mi'+b[2]).append(a))});$('#html-menu div.i, #html-menu div.sm').not('[id^='+$.cookie('html-menu-selection')+'_]').hide();$('#html-menu div.m').each(function(){$(this).click(function(){$.cookie('html-menu-selection',$(this).attr('id'));$('#html-menu div.mi').not('div.m').not('[id^='+$(this).attr('id')+'_]').hide();$('#html-menu div.mi[id^='+$(this).attr('id')+'_]').toggle()})})})
+$(function(){$([% JSON.json(sections) %]).each(function(i,b){var a=$('<a class="ml">').append($('<span class="mii ms">').append($('<div>').addClass(b[3])),$('<span class="mic">').append(b[0]));if(b[5])a.attr('href', b[5]);if(b[6])a.attr('target', b[6]);$('#html-menu').append($('<div class="mi">').addClass(b[4]).addClass(b[1]).attr('id','mi'+b[2]).append(a))});$('#html-menu div.i, #html-menu div.sm').not('[id^='+$.cookie('html-menu-selection')+'_]').hide();$('#html-menu div.m').each(function(){$(this).click(function(){$.cookie('html-menu-selection',$(this).attr('id'));$('#html-menu div.mi').not('div.m').not('[id^='+$(this).attr('id')+'_]').hide();$('#html-menu div.mi[id^='+$(this).attr('id')+'_]').toggle()})})})