Revision 62d7ed6e
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($menuitem); |
|
116 |
$menuitem->{module} ||= $::form->{script}; |
|
117 |
$menuitem->{action} ||= "section_menu"; |
|
118 |
$menuitem->{target} ||= "main_window"; |
|
119 |
$menuitem->{href} ||= "$item->{module}?action=$item->{action}"; |
|
120 |
|
|
121 |
# add other params |
|
122 |
foreach my $key (keys %$item) { |
|
123 |
next if $key =~ /target|module|action|href/; |
|
124 |
$menuitem->{href} .= "&" . $::form->escape($key, 1) . "="; |
|
125 |
my ($value, $conf) = split(/=/, $item->{$key}, 2); |
|
126 |
$value = $::myconfig{$value} . "/$conf" if ($conf); |
|
127 |
$item->{href} .= $::form->escape($value, 1); |
|
128 |
} |
|
117 | 129 |
|
118 | 130 |
my $anchor = $menuitem->{href}; |
119 | 131 |
|
... | ... | |
143 | 155 |
return @items; |
144 | 156 |
} |
145 | 157 |
|
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 |
|
|
168 | 158 |
sub make_item { |
169 | 159 |
my %params = @_; |
170 | 160 |
$params{a} ||= ''; |
Auch abrufbar als: Unified diff
menuitem entfernt