Index: Core.pm =================================================================== --- Core.pm (revision 4) +++ Core.pm (working copy) @@ -112,7 +112,9 @@ $rowNr--; next; } - s/^(\s*)\|(.*)/handleTableRow( $1, $2, $tableNr, $cgiRows, $rowNr, $doEdit, 0, $theWeb, $theTopic )/eo; + s/^(\s*)\|(.*)/handleTableRow( $1, $2, $tableNr, $cgiRows, $rowNr, $doEdit, 0, $theWeb, $theTopic )/eo + unless ( $params{'keywordlock'} and /\|\s+($params{'keywordlock'})\s+\|/ ); + } elsif( $insideTable ) { # end of table @@ -194,6 +196,16 @@ $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'editbutton' ); $$theHashRef{'editbutton'} = $tmp if( $tmp ); + $tmp = &TWiki::Func::extractNameValuePair( $theArgs, 'keywordmove' ); + $$theHashRef{'keywordmove'} = $tmp if( $tmp ); + + $tmp = &TWiki::Func::extractNameValuePair( $theArgs, 'moverows' ); + $$theHashRef{'moverows'} = $tmp if( $tmp ); + + $tmp = &TWiki::Func::extractNameValuePair( $theArgs, 'keywordlock' ); + $$theHashRef{'keywordlock'} = $tmp if( $tmp ); + + return; } @@ -227,6 +239,10 @@ 'quietsave' => $prefQUIETSAVE, 'helptopic' => '', 'editbutton' => '', + 'moverows' => '', + 'keywordmove' => '', + 'keywordlock' => '', + ); my $iTopic = TWiki::Func::extractNameValuePair( $theArgs, 'include' ); @@ -662,6 +678,9 @@ my $insideTable = 0; my $doSave = 0; my $result = ''; + my $append = ''; + my $topicAppend = ''; + # appended stuff is a hack to handle EDITTABLE correctly if at end foreach( split( /\r?\n/, "$text\n\n" ) ) { if( /%EDITTABLE{(.*)}%/o ) { @@ -680,7 +699,10 @@ next; } s/^(\s*)\|(.*)/&handleTableRow( $1, $2, $tableNr, $cgiRows, $rowNr, 1, 1, $theWeb, $theTopic )/eo; - + if ( $params{'keywordmove'} and /\|\s+($params{'keywordmove'})\s+\|/ ) { + if ( $append ) { $append .= "\n$_"; } else { $append = "$_"; } + next; + } } elsif( $insideTable ) { $insideTable = 0; if( $rowNr < $cgiRows ) { @@ -691,6 +713,12 @@ } $doSave = 0; $rowNr = 0; + if ( $append and $params{'keywordmove'} ) { + if ( $params{'moverows'} =~ /^after$/oi) { $result .= "\n$append"; } + if ( $params{'moverows'} =~ /^end$/oi) { $result .= "$append\n"; } + if ( $params{'moverows'} =~ /^topicend$/oi) { $topicAppend .= "$append\n"; } + } + $append=''; } if( /^\s*$/ ) { # empty line if( $doSave ) { @@ -713,7 +741,7 @@ } $result =~ s|\n\n$||o; # clean up hack that handles EDITTABLE correctly if at end - my $error = TWiki::Func::saveTopicText( $theWeb, $theTopic, $result, '', $quiet ); + my $error = TWiki::Func::saveTopicText( $theWeb, $theTopic, $result.$topicAppend, '', $quiet ); TWiki::Func::setTopicEditLock( $theWeb, $theTopic, 0 ); # unlock Topic my $url = TWiki::Func::getViewUrl( $theWeb, $theTopic ); if( $error ) {