*** EditTablePlugin.pm.orig Tue May 6 19:19:29 2003 --- EditTablePlugin.pm Tue May 6 19:18:45 2003 *************** *** 47,53 **** use vars qw( $web $topic $user $installWeb $VERSION $debug $query $renderingWeb ! $preSp $header $footer @format $changeRows $helpTopic $nrCols $encodeStart $encodeEnd $table ); --- 47,54 ---- use vars qw( $web $topic $user $installWeb $VERSION $debug $query $renderingWeb ! $preSp $header $footer @format @formatExpansed ! $changeRows $helpTopic $nrCols $encodeStart $encodeEnd $table ); *************** *** 291,296 **** --- 292,300 ---- # FIXME: *very* crude encoding to escape Wiki rendering inside form fields $theText =~ s/\./%dot%/gos; $theText =~ s/(.)/\.$1/gos; + + # convert
markup to unicode linebreak character for text areas + $theText =~ s/.<.b.r. .\/.>/ /gos; return $theText; } *************** *** 301,310 **** $theText =~ s/\.(.)/$1/gos; $theText =~ s/%dot%/\./gos; ! $theText =~ s/\&([^a-z])/&$1/go; # escape non-entities ! $theText =~ s//\>/go; # change > to entity ! $theText =~ s/\"/\"/go; # change " to entity return $theText; } --- 305,314 ---- $theText =~ s/\.(.)/$1/gos; $theText =~ s/%dot%/\./gos; ! $theText =~ s/\&([^#a-z])/&$1/go; # escape non-entities ! $theText =~ s//\>/go; # change > to entity ! $theText =~ s/\"/\"/go; # change " to entity return $theText; } *************** *** 360,365 **** --- 364,374 ---- $format[0] = "text,16" unless @format; $nrCols = @format; + # expansed form to be able to use %-vars in format + $tFormat =~ s///gos; + $tFormat = &TWiki::Func::expandCommonVariables( $tFormat, $theTopic, $theWeb ); + @formatExpansed = split( /\s*\|\s*/, $tFormat ); + $formatExpansed[0] = "text,16" unless @formatExpansed; # FIXME: No handling yet of footer return "$preSp"; *************** *** 429,447 **** my $i = @format - 1; $i = $theCol if( $theCol < $i ); my @bits = split( /,\s*/, $format[$i] ); my $type = "text"; $type = $bits[0] if @bits > 0; my $size = 0; $size = $bits[1] if @bits > 1; my $val = ""; my $sel = ""; if( $type eq "select" ) { $size = 1 if $size < 1; ! $text = ""; ! } else { # if( $type eq "text" ) $size = 16 if $size < 1; $theValue = $encodeStart . encodeValue( $theValue ) . $encodeEnd if $theValue; ! $text = ""; } return $text; } --- 488,505 ---- $theValue = $encodeStart . encodeValue( $theValue ) . $encodeEnd if $theValue; $text .= ""; ! } elsif( $type eq "textarea" ) { ! my ($rows, $cols) = split( /x/, $size ); ! $rows = 3 if $rows < 1; ! $cols = 30 if $cols < 1; ! ! $theValue = $encodeStart . encodeValue( $theValue ) . $encodeEnd if $theValue; ! $text .= "$theValue"; ! ! } else { # if( $type eq "text") $size = 16 if $size < 1; $theValue = $encodeStart . encodeValue( $theValue ) . $encodeEnd if $theValue; ! $text = ""; } return $text; } *************** *** 504,510 **** $cellDefined = 0; $val = $query->param( "etcell${theRowNr}x$col" ); if( defined $val ) { ! $val =~ s/[\n\r]/ /gos; # Netscape on Unix can have new lines in an edit field $cellDefined = 1; $cell = $val; } elsif( $col <= @cells ) { --- 525,532 ---- $cellDefined = 0; $val = $query->param( "etcell${theRowNr}x$col" ); if( defined $val ) { ! # change any new line character sequences to
! $val =~ s/(\n\r?)|(\r\n?)+/
/gos; $cellDefined = 1; $cell = $val; } elsif( $col <= @cells ) {