Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1ec0f541

Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt

  • ID 1ec0f541eb70afb7b2058acf9d6847e6e6e21dff
  • Vorgänger abde405d
  • Nachfolger e8a2b965

Helferfunktion L.yes_no_tag()

Implementiert die Standard-"Ja/Nein"-Selectbox via L.select_tag(...,
L.options_for_select())

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
252 252
  return $code;
253 253
}
254 254

  
255
sub yes_no_tag {
256
  my ($self, $name, $value) = splice @_, 0, 3;
257
  my %attributes            = _hashify(@_);
258

  
259
  my $options               = $self->options_for_select([ [ 1, $::locale->text('Yes') ], [ 0, $::locale->text('No') ] ], default => $value ? 1 : 0);
260
  return $self->select_tag($name, $options, %attributes);
261
}
262

  
255 263
sub javascript {
256 264
  my ($self, $data) = @_;
257 265
  return $self->html_tag('script', $data, type => 'text/javascript');
......
629 637
reference then it will be passed to L</options_for_select>
630 638
automatically.
631 639

  
640
=item C<yes_no_tag $name, $value, %attributes>
641

  
642
Creates a HTML 'select' tag with the two entries C<yes> and C<no> by
643
calling L<select_tag> and L<options_for_select>. C<$value> determines
644
which entry is selected. The C<%attributes> are passed through to
645
L<select_tag>.
646

  
632 647
=item C<input_tag $name, $value, %attributes>
633 648

  
634 649
Creates a HTML 'input type=text' tag named C<$name> with the value

Auch abrufbar als: Unified diff