From: <de...@de...> - 2016-08-31 04:07:42
|
Author: PeterThoeny Date: 2016-08-31 04:06:54 +0000 (Wed, 31 Aug 2016) New Revision: 30248 Trac url: http://develop.twiki.org/trac/changeset/30248 Modified: twiki/trunk/core/lib/TWiki/Render.pm Log: Item7754: EDITFORMFIELD variable with textarea support Modified: twiki/trunk/core/lib/TWiki/Render.pm =================================================================== --- twiki/trunk/core/lib/TWiki/Render.pm 2016-08-20 00:53:25 UTC (rev 30247) +++ twiki/trunk/core/lib/TWiki/Render.pm 2016-08-31 04:06:54 UTC (rev 30248) @@ -1525,6 +1525,28 @@ my $html = '</form>'; return $html; + } elsif( $type =~ /^textarea$/ ) { + # special case, construct <textara></textarea> tags + my $html = "<textarea name=\"$formField\""; + my $needsClass = 1; + my $class = 'twikiTextarea'; + foreach my $key ( keys %$params ) { + next if( $key =~ /^(_DEFAULT|_RAW|name|size|type|text|value)$/i ); + $needsClass = 0 if( $key =~ /^class$/i ); + $html .= " $key=\"" . $params->{$key} . '"'; + } + my $size = $params->{size} || ''; + if( $size =~ /^([0-9]+)x([0-9]+)$/ ) { + $html .= " cols=\"$1\" rows=\"$2\""; + } elsif( $size =~ /^([0-9]+)$/ ) { + $html .= " cols=\"$1\" rows=\"6\""; + } + if( $needsClass ) { + $html .= ' class="twikiTextarea"'; + } + $html .= '>' . $value . '</textarea>'; + return $html; + } elsif( $type ) { # special case, construct an <input type="" /> tag my $html = "<input name=\"$formField\" type=\"$type\""; |