Revision 50cd4bda
Von Sven Schöling vor mehr als 10 Jahren hinzugefügt
SL/Presenter/Tag.pm | ||
---|---|---|
190 | 190 |
} |
191 | 191 |
|
192 | 192 |
sub _set_id_attribute { |
193 |
my ($attributes, $name) = @_; |
|
193 |
my ($attributes, $name, $unique) = @_;
|
|
194 | 194 |
|
195 |
$attributes->{id} = name_to_id(undef, $name) if !delete($attributes->{no_id}) && !$attributes->{id}; |
|
195 |
if (!delete($attributes->{no_id}) && !$attributes->{id}) { |
|
196 |
$attributes->{id} = name_to_id(undef, $name); |
|
197 |
$attributes->{id} .= '_' . $attributes->{value} if $unique; |
|
198 |
} |
|
196 | 199 |
|
197 | 200 |
return %{ $attributes }; |
198 | 201 |
} |
SL/Template/Plugin/L.pm | ||
---|---|---|
69 | 69 |
sub part_picker { return _call_presenter('part_picker', @_); } |
70 | 70 |
|
71 | 71 |
sub _set_id_attribute { |
72 |
my ($attributes, $name) = @_; |
|
73 |
SL::Presenter::Tag::_set_id_attribute($attributes, $name); |
|
72 |
my ($attributes, $name, $unique) = @_;
|
|
73 |
SL::Presenter::Tag::_set_id_attribute($attributes, $name, $unique);
|
|
74 | 74 |
} |
75 | 75 |
|
76 | 76 |
sub img_tag { |
... | ... | |
119 | 119 |
sub radio_button_tag { |
120 | 120 |
my ($self, $name, %attributes) = _hashify(2, @_); |
121 | 121 |
|
122 |
_set_id_attribute(\%attributes, $name); |
|
123 | 122 |
$attributes{value} = 1 unless exists $attributes{value}; |
124 |
$attributes{id} .= '_' . $attributes{value}; |
|
123 |
|
|
124 |
_set_id_attribute(\%attributes, $name, 1); |
|
125 | 125 |
my $label = delete $attributes{label}; |
126 | 126 |
|
127 | 127 |
if ($attributes{checked}) { |
Auch abrufbar als: Unified diff
L.radio_button_tag: id erhalten wenn sie schon vorher gesetzt ist.