Revision f559ec45
Von Holger Will vor etwa 17 Jahren hinzugefügt
SL/Menu.pm | ||
---|---|---|
164 | 164 |
return $str; |
165 | 165 |
} |
166 | 166 |
|
167 |
sub menuitem_XML { |
|
168 |
$main::lxdebug->enter_sub(); |
|
169 |
|
|
170 |
my ($self, $myconfig, $form, $item, $other) = @_; |
|
171 |
|
|
172 |
my $module = $form->{script}; |
|
173 |
my $action = "section_menu"; |
|
174 |
my $target = ""; |
|
175 |
|
|
176 |
if ($self->{$item}{module}) { |
|
177 |
$module = $self->{$item}{module}; |
|
178 |
} |
|
179 |
if ($self->{$item}{action}) { |
|
180 |
$action = $self->{$item}{action}; |
|
181 |
} |
|
182 |
if ($self->{$item}{target}) { |
|
183 |
$target = $self->{$item}{target}; |
|
184 |
} |
|
185 |
|
|
186 |
my $level = $form->escape($item); |
|
187 |
|
|
188 |
my $str = qq| link="$module?action=| . $form->escape($action) . |
|
189 |
qq|&level=| . $form->escape($level); |
|
190 |
map({ $str .= "&${_}=" . $form->escape($form->{$_}); } qw(login password)); |
|
191 |
|
|
192 |
my @vars = qw(module action target href); |
|
193 |
|
|
194 |
if ($self->{$item}{href}) { |
|
195 |
$str = qq| link=$self->{$item}{href}|; |
|
196 |
@vars = qw(module target href); |
|
197 |
} |
|
198 |
|
|
199 |
map { delete $self->{$item}{$_} } @vars; |
|
200 |
|
|
201 |
# add other params |
|
202 |
foreach my $key (keys %{ $self->{$item} }) { |
|
203 |
$str .= "&" . $form->escape($key, 1) . "="; |
|
204 |
($value, $conf) = split(/=/, $self->{$item}{$key}, 2); |
|
205 |
$value = $myconfig->{$value} . "/$conf" if ($conf); |
|
206 |
$str .= $form->escape($value, 1); |
|
207 |
} |
|
208 |
|
|
209 |
$str .= '"'; |
|
210 |
|
|
211 |
|
|
212 |
|
|
213 |
if ($other) { |
|
214 |
foreach my $key (keys(%{$other})) { |
|
215 |
$str .= qq| ${key}="| . $form->quote($other->{$key}) . qq|"|; |
|
216 |
} |
|
217 |
} |
|
218 |
|
|
219 |
|
|
220 |
$main::lxdebug->leave_sub(); |
|
221 |
|
|
222 |
return $str; |
|
223 |
} |
|
224 |
|
|
167 | 225 |
sub menuitemNew { |
168 | 226 |
my ($self, $myconfig, $form, $item) = @_; |
169 | 227 |
|
Auch abrufbar als: Unified diff
XML basiertes Menue, siehe Bug #771