Revision ee51b82f
Von Tamino Steinert vor etwa 2 Jahren hinzugefügt
SL/Presenter/Part.pm | ||
---|---|---|
24 | 24 |
|
25 | 25 |
croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/; |
26 | 26 |
|
27 |
my $text = join '', ( |
|
28 |
$params{no_link} ? '' : '<a href="controller.pl?action=Part/edit&part.id=' . escape($part->id) . '">', |
|
29 |
escape($part->partnumber), |
|
30 |
$params{no_link} ? '' : '</a>', |
|
31 |
); |
|
27 |
my $text = escape($part->partnumber); |
|
28 |
if (! delete $params{no_link}) { |
|
29 |
my $href = 'controller.pl?action=Part/edit' |
|
30 |
. '&part.id=' . escape($part->id); |
|
31 |
$text = link_tag($href, $text, %params); |
|
32 |
} |
|
32 | 33 |
|
33 | 34 |
is_escaped($text); |
34 | 35 |
} |
... | ... | |
163 | 164 |
Returns a rendered version (actually an instance of |
164 | 165 |
L<SL::Presenter::EscapedText>) of the part object C<$object> |
165 | 166 |
|
166 |
C<%params> can include: |
|
167 |
Remaining C<%params> are passed to the function |
|
168 |
C<SL::Presenter::Tag::link_tag>. It can include: |
|
167 | 169 |
|
168 | 170 |
=over 4 |
169 | 171 |
|
170 | 172 |
=item * display |
171 | 173 |
|
172 |
Either C<inline> (the default) or C<table-cell>. At the moment both |
|
173 |
representations are identical and produce the part's name linked |
|
174 |
to the corresponding 'edit' action. |
|
174 |
Either C<inline> (the default) or C<table-cell>. Is passed to the function |
|
175 |
C<SL::Presenter::Tag::link_tag>. |
|
176 |
|
|
177 |
=item * no_link |
|
178 |
|
|
179 |
If falsish (the default) then the part number will be linked to the "edit" |
|
180 |
dialog. |
|
175 | 181 |
|
176 | 182 |
=back |
177 | 183 |
|
Auch abrufbar als: Unified diff
Presenter: nutze link_tag anstelle von html im perl-code
(cherry picked aus Kundenprojekt)