Revision 88bd305a
Von Sven Schöling vor etwa 12 Jahren hinzugefügt
bin/mozilla/menu.pl | ||
---|---|---|
113 | 113 |
|
114 | 114 |
$label = $::locale->text($label); |
115 | 115 |
|
116 |
$menuitem->{target} ||= "main_window";
|
|
116 |
menuitem($menuitem);
|
|
117 | 117 |
|
118 |
my $anchor = $menu->menuitem(\%::myconfig, $::form, $item, $level);
|
|
118 |
my $anchor = $menuitem->{href};
|
|
119 | 119 |
|
120 | 120 |
if (!$level) { # toplevel |
121 | 121 |
my $ml_ = $::form->escape($ml); |
122 | 122 |
my $image = make_image(icon => $item . '.png', size => 24, label => $label); |
123 |
my $anchor = "<a href='menu.pl?action=acc_menu&level=$ml_' class='nohover' title='$label'>";
|
|
123 |
my $anchor = "menu.pl?action=acc_menu&level=$ml_";
|
|
124 | 124 |
|
125 |
push @items, make_item(a => $anchor, img => $image, label => $label, height => 24, class => 'menu');
|
|
125 |
push @items, make_item(href => $anchor, img => $image, label => $label, height => 24, class => 'menu');
|
|
126 | 126 |
push @items, section_menu($menu, $item); |
127 | 127 |
|
128 | 128 |
} elsif ($menuitem->{submenu}) { |
129 | 129 |
my $image = make_image(submenu => 1); |
130 | 130 |
if ($mainlevel && $item =~ /^\Q$mainlevel\E/) { |
131 |
push @items, make_item(spacer => $spacer, bold => 1, img => $image, label => $label, class => 'submenu') if $show; |
|
131 |
push @items, make_item(target => $menuitem->{target}, spacer => $spacer, bold => 1, img => $image, label => $label, class => 'submenu') if $show;
|
|
132 | 132 |
push @items, section_menu($menu, $item); |
133 | 133 |
} else { |
134 |
push @items, make_item(spacer => $spacer, a => $anchor, img => $image, label => $label . ' ...', class => 'submenu') if $show;
|
|
134 |
push @items, make_item(spacer => $spacer, href => $anchor, img => $image, label => $label . ' ...', class => 'submenu') if $show;
|
|
135 | 135 |
} |
136 | 136 |
} elsif ($menuitem->{module}) { |
137 | 137 |
my $image = make_image(label => $label, icon => $label_icon); |
138 |
push @items, make_item(img => $image, a => $anchor, spacer => $spacer, label => $label, class => 'item') if $show;
|
|
138 |
push @items, make_item(target => $menuitem->{target}, img => $image, href => $anchor, spacer => $spacer, label => $label, class => 'item') if $show;
|
|
139 | 139 |
push @items, section_menu($menu, $item) if $show && $::form->{$item} && $::form->{level} eq $item; |
140 | 140 |
} |
141 | 141 |
} |
... | ... | |
143 | 143 |
return @items; |
144 | 144 |
} |
145 | 145 |
|
146 |
sub menuitem { |
|
147 |
my ($item, $name) = @_; |
|
148 |
|
|
149 |
$item->{module} ||= $::form->{script}; |
|
150 |
$item->{action} ||= "section_menu"; |
|
151 |
$item->{target} ||= "main_window"; |
|
152 |
$item->{href} ||= "$item->{module}?action=$item->{action}"; |
|
153 |
|
|
154 |
# add other params |
|
155 |
foreach my $key (keys %$item) { |
|
156 |
next if $key =~ /target|module|action|href/; |
|
157 |
$item->{href} .= "&" . $::form->escape($key, 1) . "="; |
|
158 |
my ($value, $conf) = split(/=/, $item->{$key}, 2); |
|
159 |
$value = $::myconfig{$value} . "/$conf" if ($conf); |
|
160 |
$item->{href} .= $::form->escape($value, 1); |
|
161 |
} |
|
162 |
|
|
163 |
# my $str = "<a href='$href' $target_token>"; |
|
164 |
# |
|
165 |
# return $str; |
|
166 |
} |
|
167 |
|
|
146 | 168 |
sub make_item { |
147 | 169 |
my %params = @_; |
148 | 170 |
$params{a} ||= ''; |
Auch abrufbar als: Unified diff
menuitem nach menu.pl verlagert. links in template generiert