From: Sven Schöling Date: Tue, 7 May 2013 13:24:27 +0000 (+0200) Subject: areainput implementierung von cetaq übernommen X-Git-Tag: release-3.2.0beta~467^2~169 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=cbd9fcfa6ea24ebbd27b807d0b559b08a908b642;p=kivitendo-erp.git areainput implementierung von cetaq übernommen --- diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 241141625..4b56da832 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -344,19 +344,14 @@ sub tab { sub areainput_tag { my ($self, $name, $value, %attributes) = _hashify(3, @_); - my ($rows, $cols); - my $min = delete $attributes{min_rows} || 1; - - if (exists $attributes{cols}) { - $cols = delete $attributes{cols}; - $rows = $::form->numtextrows($value, $cols); - } else { - $rows = delete $attributes{rows} || 1; - } + my $cols = delete $attributes{cols} || delete $attributes{size}; + my $minrows = delete $attributes{min_rows} || 1; + my $maxrows = delete $attributes{max_rows}; + my $rows = $::form->numtextrows($value, $cols, $maxrows, $minrows); return $rows > 1 - ? $self->textarea_tag($name, $value, %attributes, rows => max($rows, $min), ($cols ? (cols => $cols) : ())) - : $self->input_tag($name, $value, %attributes, ($cols ? (size => $cols) : ())); + ? $self->textarea_tag($name, $value, %attributes, rows => $rows, cols => $cols) + : $self->input_tag($name, $value, %attributes, size => $cols); } sub multiselect2side {