Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 796598ed

Von Sven Schöling vor mehr als 12 Jahren hinzugefügt

  • ID 796598ed8f166e284da918c34ca6dd949a0a91f9
  • Vorgänger 3afb4275
  • Nachfolger d1123673

L.areainput_tag: cols als parameter akzeptieren.

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
421 421
  my ($self, $name, $value, @slurp) = @_;
422 422
  my %attributes      = _hashify(@slurp);
423 423

  
424
  my $rows = delete $attributes{rows}     || 1;
424
  my ($rows, $cols);
425 425
  my $min  = delete $attributes{min_rows} || 1;
426 426

  
427
  if (exists $attributes{cols}) {
428
    $cols = delete $attributes{cols};
429
    $rows = $::form->numtextrows($value, $cols);
430
  } else {
431
    $rows = delete $attributes{rows} || 1;
432
  }
433

  
427 434
  return $rows > 1
428
    ? $self->textarea_tag($name, $value, %attributes, rows => max $rows, $min)
429
    : $self->input_tag($name, $value, %attributes);
435
    ? $self->textarea_tag($name, $value, %attributes, rows => max($rows, $min), ($cols ? (cols => $cols) : ()))
436
    : $self->input_tag($name, $value, %attributes, ($cols ? (size => $cols) : ()));
430 437
}
431 438

  
432 439
sub multiselect2side {
......
691 698
=item C<areainput_tag $name, $content, %PARAMS>
692 699

  
693 700
Creates a generic input tag or textarea tag, depending on content size. The
694
mount of desired rows must be given with C<rows> parameter, Accpeted parameters
701
amount of desired rows must be either given with the C<rows> parameter or can
702
be computed from the value and the C<cols> paramter, Accepted parameters
695 703
include C<min_rows> for rendering a minimum of rows if a textarea is displayed.
696 704

  
697 705
You can force input by setting rows to 1, and you can force textarea by setting

Auch abrufbar als: Unified diff