Revision 0550e83a
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Presenter/Tag.pm | ||
---|---|---|
108 | 108 |
|
109 | 109 |
delete($attributes{default}); |
110 | 110 |
|
111 |
|
|
112 |
my @all_options; |
|
113 |
push @all_options, [undef, $empty_title || ''] if $with_empty; |
|
114 |
|
|
115 | 111 |
my $normalize_entry = sub { |
116 | 112 |
my ($type, $entry, $sub, $key) = @_; |
117 | 113 |
|
... | ... | |
161 | 157 |
return join '', map { $self->html_tag('option', $self->escape($_->[1]), value => $_->[0], selected => $_->[2]) } @options; |
162 | 158 |
}; |
163 | 159 |
|
164 |
my $code; |
|
160 |
my $code = ''; |
|
161 |
$code .= $self->html_tag('option', $self->escape($empty_title || '')) if $with_empty; |
|
165 | 162 |
|
166 | 163 |
if (!$with_optgroups) { |
167 |
$code = $list_to_code->($collection); |
|
164 |
$code .= $list_to_code->($collection);
|
|
168 | 165 |
|
169 | 166 |
} else { |
170 |
$code = join '', map { |
|
167 |
$code .= join '', map {
|
|
171 | 168 |
my ($optgroup_title, $sub_collection) = @{ $_ }; |
172 | 169 |
$self->html_tag('optgroup', $list_to_code->($sub_collection), label => $optgroup_title) |
173 | 170 |
} @{ $collection }; |
Auch abrufbar als: Unified diff
select_tag(): Funktionalität von "with_empty" wiederherstellen
Behebt #2208.