26a27 > TWiki::Func::registerTagHandler( 'EDITTABLEROW', \&_editTableRow ); 280a282,339 > sub _editTableRow { > my ($session, $params, $theTopic, $theWeb) = @_; > > my $warningEnabled = $params->{warn} || '1'; > if ( $warningEnabled =~ m/^(off|0)$/i ) { $warningEnabled = 0; } else { $warningEnabled = 1; }; > > my ($web, $topic) = TWiki::Func::normalizeWebTopicName( $theWeb, $params->{topic} || $theTopic ); > my ($meta, $text) = TWiki::Func::readTopic( $web, $topic ); > > my $line = ''; # return value > > # dont check CHANGE permissions here, since that is subject to the save script > if ( TWiki::Func::checkAccessPermission('VIEW', TWiki::Func::getWikiName(), $text, $topic, $web, $meta) ) { > > my $table_num = $params->{table} || '0'; > my $row_num = $params->{row} || '0'; > > my $redirect = $params->{redirect} || '0'; > if ( $redirect =~ m/^(on|1)$/i ) { $redirect = 1; } else { $redirect = 0; }; > > my $urps = {}; > > my $content = TWiki::Plugins::EditRowPlugin::Table::parseTables( > $text, $topic, $web, $meta, $urps); > > my $table = @$content[$table_num]; > if (ref($table) eq 'TWiki::Plugins::EditRowPlugin::Table') { > my $row = $table->{rows}[$row_num]; > if ($row_num != 0 && ref($row) eq 'TWiki::Plugins::EditRowPlugin::TableRow') { > > # disable move up/down and add/delete buttons > $table->{attrs}->{changerows} = 0; > > # compose html form > my $saveUrl = > TWiki::Func::getScriptUrl($pluginName, 'save', 'rest'); > $line = CGI::start_form( > -method =>'POST', > -name => 'erp_form_'.$table_num, > -action => $saveUrl); > $line .= CGI::hidden('erp_noredirect', $redirect); > $line .= CGI::hidden('erp_active_topic', "$web.$topic"); > $line .= CGI::hidden('erp_active_table', $table_num); > $line .= CGI::hidden('erp_active_row', ($row_num+1)); > my @tmpRows = $row->renderForEdit($table->{colTypes}, 1, 'horizontal'); > $line .= "\n".$tmpRows[0]."\n"; > $line .= CGI::end_form(); > > } elsif ($warningEnabled) { > $line = "%RED% Warning: Row no. " . $row_num . " not found. %ENDCOLOR%"; > } > } > } elsif ($warningEnabled) { > $line = "%RED% Warning: No permission to read topic !$web.$topic. %ENDCOLOR%"; > } > return $line; > } >