Revision 4a12c839
Von Sven Schöling vor etwa 12 Jahren hinzugefügt
SL/Menu.pm | ||
---|---|---|
58 | 58 |
return $self; |
59 | 59 |
} |
60 | 60 |
|
61 |
sub menuitem_js { |
|
62 |
my ($self, $myconfig, $form, $item) = @_; |
|
63 |
|
|
64 |
my $module = $form->{script}; |
|
65 |
my $action = "section_menu"; |
|
66 |
|
|
67 |
#if ($self->{$item}{module}) { |
|
68 |
$module = $self->{$item}{module}; |
|
69 |
|
|
70 |
#} |
|
71 |
if ($self->{$item}{action}) { |
|
72 |
$action = $self->{$item}{action}; |
|
73 |
} |
|
74 |
|
|
75 |
my $level = $form->escape($item); |
|
76 |
my $str = qq|$module?action=$action&level=$level|; |
|
77 |
my @vars = qw(module action target href); |
|
78 |
|
|
79 |
if ($self->{$item}{href}) { |
|
80 |
$str = qq|$self->{$item}{href}|; |
|
81 |
@vars = qw(module target href); |
|
82 |
} |
|
83 |
|
|
84 |
map { delete $self->{$item}{$_} } @vars; |
|
85 |
|
|
86 |
# add other params |
|
87 |
foreach my $key (keys %{ $self->{$item} }) { |
|
88 |
$str .= "&" . $form->escape($key, 1) . "="; |
|
89 |
my ($value, $conf) = split(/=/, $self->{$item}{$key}, 2); |
|
90 |
$value = $myconfig->{$value} . "/$conf" if ($conf); |
|
91 |
$str .= $form->escape($value, 1); |
|
92 |
} |
|
93 |
|
|
94 |
$str .= " "; |
|
95 |
|
|
96 |
} |
|
97 |
|
|
98 | 61 |
sub menuitem_new { |
99 | 62 |
$main::lxdebug->enter_sub(); |
100 | 63 |
|
... | ... | |
124 | 87 |
$main::lxdebug->leave_sub(); |
125 | 88 |
} |
126 | 89 |
|
127 |
sub menuitem_v3 { |
|
128 |
$main::lxdebug->enter_sub(); |
|
129 |
|
|
130 |
my ($self, $myconfig, $form, $item, $other) = @_; |
|
131 |
|
|
132 |
my $module = $form->{script}; |
|
133 |
my $action = "section_menu"; |
|
134 |
my $target = ""; |
|
135 |
|
|
136 |
if ($self->{$item}{module}) { |
|
137 |
$module = $self->{$item}{module}; |
|
138 |
} |
|
139 |
if ($self->{$item}{action}) { |
|
140 |
$action = $self->{$item}{action}; |
|
141 |
} |
|
142 |
if ($self->{$item}{target}) { |
|
143 |
$target = $self->{$item}{target}; |
|
144 |
} |
|
145 |
|
|
146 |
my $level = $form->escape($item); |
|
147 |
|
|
148 |
my $str = qq|<a href="$module?action=| . $form->escape($action) . qq|&level=| . $form->escape($level); |
|
149 |
|
|
150 |
my @vars = qw(module action target href); |
|
151 |
|
|
152 |
if ($self->{$item}{href}) { |
|
153 |
$str = qq|<a href=$self->{$item}{href}|; |
|
154 |
@vars = qw(module target href); |
|
155 |
} |
|
156 |
|
|
157 |
map { delete $self->{$item}{$_} } @vars; |
|
158 |
|
|
159 |
# add other params |
|
160 |
foreach my $key (keys %{ $self->{$item} }) { |
|
161 |
$str .= "&" . $form->escape($key, 1) . "="; |
|
162 |
my ($value, $conf) = split(/=/, $self->{$item}{$key}, 2); |
|
163 |
$value = $myconfig->{$value} . "/$conf" if ($conf); |
|
164 |
$str .= $form->escape($value, 1); |
|
165 |
} |
|
166 |
|
|
167 |
$str .= '"'; |
|
168 |
|
|
169 |
if ($target) { |
|
170 |
$str .= qq| target="| . $form->quote($target) . qq|"|; |
|
171 |
} |
|
172 |
|
|
173 |
if ($other) { |
|
174 |
foreach my $key (keys(%{$other})) { |
|
175 |
$str .= qq| ${key}="| . $form->quote($other->{$key}) . qq|"|; |
|
176 |
} |
|
177 |
} |
|
178 |
|
|
179 |
$str .= ">"; |
|
180 |
|
|
181 |
$main::lxdebug->leave_sub(); |
|
182 |
|
|
183 |
return $str; |
|
184 |
} |
|
185 |
|
|
186 |
sub menuitem_XML { |
|
187 |
$main::lxdebug->enter_sub(); |
|
188 |
|
|
189 |
my ($self, $myconfig, $form, $item, $other) = @_; |
|
190 |
|
|
191 |
my $module = $form->{script}; |
|
192 |
my $action = "section_menu"; |
|
193 |
my $target = ""; |
|
194 |
|
|
195 |
if ($self->{$item}{module}) { |
|
196 |
$module = $self->{$item}{module}; |
|
197 |
} |
|
198 |
if ($self->{$item}{action}) { |
|
199 |
$action = $self->{$item}{action}; |
|
200 |
} |
|
201 |
if ($self->{$item}{target}) { |
|
202 |
$target = $self->{$item}{target}; |
|
203 |
} |
|
204 |
|
|
205 |
my $level = $form->escape($item); |
|
206 |
|
|
207 |
my $str = qq| link="$module?action=| . $form->escape($action) . |
|
208 |
qq|&level=| . $form->escape($level); |
|
209 |
|
|
210 |
my @vars = qw(module action target href); |
|
211 |
|
|
212 |
if ($self->{$item}{href}) { |
|
213 |
$str = qq| link=$self->{$item}{href}|; |
|
214 |
@vars = qw(module target href); |
|
215 |
} |
|
216 |
|
|
217 |
map { delete $self->{$item}{$_} } @vars; |
|
218 |
|
|
219 |
# add other params |
|
220 |
foreach my $key (keys %{ $self->{$item} }) { |
|
221 |
$str .= "&" . $form->escape($key, 1) . "="; |
|
222 |
my ($value, $conf) = split(/=/, $self->{$item}{$key}, 2); |
|
223 |
$value = $myconfig->{$value} . "/$conf" if ($conf); |
|
224 |
$str .= $form->escape($value, 1); |
|
225 |
} |
|
226 |
|
|
227 |
$str .= '"'; |
|
228 |
|
|
229 |
|
|
230 |
|
|
231 |
if ($other) { |
|
232 |
foreach my $key (keys(%{$other})) { |
|
233 |
$str .= qq| ${key}="| . $form->quote($other->{$key}) . qq|"|; |
|
234 |
} |
|
235 |
} |
|
236 |
|
|
237 |
|
|
238 |
$main::lxdebug->leave_sub(); |
|
239 |
|
|
240 |
return $str; |
|
241 |
} |
|
242 |
|
|
243 | 90 |
sub access_control { |
244 | 91 |
$main::lxdebug->enter_sub(2); |
245 | 92 |
|
Auch abrufbar als: Unified diff
Layouts eingeführt
bin/mozilla/menu* -> SL/Controller/Layout/*