Ignore:
Timestamp:
11/23/08 21:47:27 (4 years ago)
Author:
ArthurClemens
Message:

Item265: update EditTablePlugin to Foswiki

Location:
trunk/EditTablePlugin/lib/Foswiki
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/EditTablePlugin/lib/Foswiki/Plugins/EditTablePlugin/Core.pm

    r781 r893  
    11# Plugin for Foswiki - The Free Open Source Wiki, http://foswiki.org/ 
    22# 
    3 # Copyright (C) 2008 Arthur Clemens, arthur@visiblearea.com 
     3# Copyright (C) 2008 Arthur Clemens, arthur@visiblearea.com and Foswiki contributors 
    44# Copyright (C) 2002-2007 Peter Thoeny, peter@thoeny.org and 
    55# TWiki Contributors. 
     
    1919# This is the EditTablePlugin used to edit tables in place. 
    2020 
    21 package TWiki::Plugins::EditTablePlugin::Core; 
     21package Foswiki::Plugins::EditTablePlugin::Core; 
    2222 
    2323use strict; 
     
    8181    #my $text = $_[0] 
    8282 
    83     $query = TWiki::Func::getCgiQuery(); 
     83    $query = Foswiki::Func::getCgiQuery(); 
    8484    if ( ( $query->param('etedit') ) && ( $query->param('ettablenr') ) ) { 
    8585        my $paramTableNr = $query->param('ettablenr'); 
    86         my $tmptable     = TWiki::Plugins::EditTable->new(); 
     86        my $tmptable     = Foswiki::Plugins::EditTable->new(); 
    8787        my ( $tablesTakenOutText, @tableTextRefs ) = 
    8888          $tmptable->parseText( $_[0] ); 
     
    129129sub process { 
    130130    init(); 
    131     my $saveMode      = $TWiki::Plugins::EditTablePlugin::saveMode{'NONE'}; 
     131    my $saveMode      = $Foswiki::Plugins::EditTablePlugin::saveMode{'NONE'}; 
    132132    my $saveTableNr   = 0; 
    133     my $saveQuietMode = $TWiki::Plugins::EditTablePlugin::saveMode{'SAVEQUIET'}; 
     133    my $saveQuietMode = $Foswiki::Plugins::EditTablePlugin::saveMode{'SAVEQUIET'}; 
    134134    processText( $saveMode, $saveTableNr, $saveQuietMode, @_ ); 
    135135} 
     
    149149sub processText { 
    150150 
    151     my $doSave = ( shift == $TWiki::Plugins::EditTablePlugin::saveMode{'SAVE'} ) 
     151    my $doSave = ( shift == $Foswiki::Plugins::EditTablePlugin::saveMode{'SAVE'} ) 
    152152      || 0; 
    153153    my $saveTableNr = shift; 
    154154    my $doSaveQuiet = 
    155       ( shift == $TWiki::Plugins::EditTablePlugin::saveMode{'SAVEQUIET'} ) || 0; 
    156  
    157     $query = TWiki::Func::getCgiQuery(); 
    158  
    159     TWiki::Func::writeDebug( 
     155      ( shift == $Foswiki::Plugins::EditTablePlugin::saveMode{'SAVEQUIET'} ) || 0; 
     156 
     157    $query = Foswiki::Func::getCgiQuery(); 
     158 
     159    Foswiki::Func::writeDebug( 
    160160        "- EditTablePlugin::commonTagsHandler( $_[2].$_[1] )") 
    161       if $TWiki::Plugins::EditTablePlugin::debug; 
     161      if $Foswiki::Plugins::EditTablePlugin::debug; 
    162162 
    163163    unless ($prefsInitialized) { 
    164164        $prefCHANGEROWS = 
    165              TWiki::Func::getPreferencesValue('CHANGEROWS') 
    166           || TWiki::Func::getPreferencesValue('EDITTABLEPLUGIN_CHANGEROWS') 
     165             Foswiki::Func::getPreferencesValue('CHANGEROWS') 
     166          || Foswiki::Func::getPreferencesValue('EDITTABLEPLUGIN_CHANGEROWS') 
    167167          || 'on'; 
    168168        $prefQUIETSAVE = 
    169              TWiki::Func::getPreferencesValue('QUIETSAVE') 
    170           || TWiki::Func::getPreferencesValue('EDITTABLEPLUGIN_QUIETSAVE') 
     169             Foswiki::Func::getPreferencesValue('QUIETSAVE') 
     170          || Foswiki::Func::getPreferencesValue('EDITTABLEPLUGIN_QUIETSAVE') 
    171171          || 'on'; 
    172172        $prefEDIT_BUTTON = 
    173              TWiki::Func::getPreferencesValue('EDIT_BUTTON') 
    174           || TWiki::Func::getPreferencesValue('EDITTABLEPLUGIN_EDIT_BUTTON') 
     173             Foswiki::Func::getPreferencesValue('EDIT_BUTTON') 
     174          || Foswiki::Func::getPreferencesValue('EDITTABLEPLUGIN_EDIT_BUTTON') 
    175175          || 'Edit table'; 
    176176        $prefSAVE_BUTTON = 
    177              TWiki::Func::getPreferencesValue('SAVE_BUTTON') 
    178           || TWiki::Func::getPreferencesValue('EDITTABLEPLUGIN_SAVE_BUTTON') 
     177             Foswiki::Func::getPreferencesValue('SAVE_BUTTON') 
     178          || Foswiki::Func::getPreferencesValue('EDITTABLEPLUGIN_SAVE_BUTTON') 
    179179          || 'Save table'; 
    180180        $prefQUIET_SAVE_BUTTON = 
    181           TWiki::Func::getPreferencesValue('QUIET_SAVE_BUTTON') 
    182           || TWiki::Func::getPreferencesValue( 
     181          Foswiki::Func::getPreferencesValue('QUIET_SAVE_BUTTON') 
     182          || Foswiki::Func::getPreferencesValue( 
    183183            'EDITTABLEPLUGIN_QUIET_SAVE_BUTTON') 
    184184          || 'Quiet save'; 
    185185        $prefADD_ROW_BUTTON = 
    186              TWiki::Func::getPreferencesValue('ADD_ROW_BUTTON') 
    187           || TWiki::Func::getPreferencesValue('EDITTABLEPLUGIN_ADD_ROW_BUTTON') 
     186             Foswiki::Func::getPreferencesValue('ADD_ROW_BUTTON') 
     187          || Foswiki::Func::getPreferencesValue('EDITTABLEPLUGIN_ADD_ROW_BUTTON') 
    188188          || 'Add row'; 
    189189        $prefDELETE_LAST_ROW_BUTTON = 
    190           TWiki::Func::getPreferencesValue('DELETE_LAST_ROW_BUTTON') 
    191           || TWiki::Func::getPreferencesValue( 
     190          Foswiki::Func::getPreferencesValue('DELETE_LAST_ROW_BUTTON') 
     191          || Foswiki::Func::getPreferencesValue( 
    192192            'EDITTABLEPLUGIN_DELETE_LAST_ROW_BUTTON') 
    193193          || 'Delete last row'; 
    194194        $prefCANCEL_BUTTON = 
    195              TWiki::Func::getPreferencesValue('CANCEL_BUTTON') 
    196           || TWiki::Func::getPreferencesValue('EDITTABLEPLUGIN_CANCEL_BUTTON') 
     195             Foswiki::Func::getPreferencesValue('CANCEL_BUTTON') 
     196          || Foswiki::Func::getPreferencesValue('EDITTABLEPLUGIN_CANCEL_BUTTON') 
    197197          || 'Cancel'; 
    198198        $prefMESSAGE_INCLUDED_TOPIC_DOES_NOT_EXIST = 
    199           TWiki::Func::getPreferencesValue('INCLUDED_TOPIC_DOES_NOT_EXIST') 
    200           || TWiki::Func::getPreferencesValue( 
     199          Foswiki::Func::getPreferencesValue('INCLUDED_TOPIC_DOES_NOT_EXIST') 
     200          || Foswiki::Func::getPreferencesValue( 
    201201            'EDITTABLEPLUGIN_INCLUDED_TOPIC_DOES_NOT_EXIST') 
    202202          || 'Warning: \'include\' topic does not exist!'; 
     
    232232    my @tableTextRefs; 
    233233    if ($doSave) { 
    234         ( $meta, $topicText ) = TWiki::Func::readTopic( $theWeb, $theTopic ); 
    235         $table = TWiki::Plugins::EditTable->new(); 
     234        ( $meta, $topicText ) = Foswiki::Func::readTopic( $theWeb, $theTopic ); 
     235        $table = Foswiki::Plugins::EditTable->new(); 
    236236        ( $tablesTakenOutText, @tableTextRefs ) = $table->parseText($topicText); 
    237237    } 
     
    239239        $topicText = $_[0]; 
    240240        if ( !defined $table ) { 
    241             $table = TWiki::Plugins::EditTable->new(); 
     241            $table = Foswiki::Plugins::EditTable->new(); 
    242242            ( $tablesTakenOutText, @tableTextRefs ) = 
    243243              $table->parseText($topicText); 
     
    290290                && (  $theWeb . '.' 
    291291                    . $theTopic eq 
    292 "$TWiki::Plugins::EditTablePlugin::web.$TWiki::Plugins::EditTablePlugin::topic" 
     292"$Foswiki::Plugins::EditTablePlugin::web.$Foswiki::Plugins::EditTablePlugin::topic" 
    293293                ) 
    294294              ) 
     
    299299                    # [Save table] button pressed 
    300300                    my $theSaveMode = 
    301                       $TWiki::Plugins::EditTablePlugin::saveMode{'SAVE'}; 
     301                      $Foswiki::Plugins::EditTablePlugin::saveMode{'SAVE'}; 
    302302                    my $theSaveQuietMode = 
    303                       $TWiki::Plugins::EditTablePlugin::saveMode{'NONE'}; 
     303                      $Foswiki::Plugins::EditTablePlugin::saveMode{'NONE'}; 
    304304 
    305305                    return processText( $theSaveMode, $tableNr, 
     
    310310                    # [Quiet save] button pressed 
    311311                    my $theSaveMode = 
    312                       $TWiki::Plugins::EditTablePlugin::saveMode{'SAVE'}; 
     312                      $Foswiki::Plugins::EditTablePlugin::saveMode{'SAVE'}; 
    313313                    my $theSaveQuietMode = 
    314                       $TWiki::Plugins::EditTablePlugin::saveMode{'SAVEQUIET'}; 
     314                      $Foswiki::Plugins::EditTablePlugin::saveMode{'SAVEQUIET'}; 
    315315                    return processText( $theSaveMode, $tableNr, 
    316316                        $theSaveQuietMode, @_ ); 
     
    367367            # match with a TablePlugin line 
    368368            # works when TABLE tag is just above OR just below the EDITTABLE tag 
    369             my %tablePluginParams = TWiki::Func::extractParameters($1); 
     369            my %tablePluginParams = Foswiki::Func::extractParameters($1); 
    370370            $headerRowCount = $tablePluginParams{'headerrows'} || 0; 
    371371            $footerRowCount = $tablePluginParams{'footerrows'} || 0; 
     
    586586    if ($doSave) { 
    587587        my $error = 
    588           TWiki::Func::saveTopic( $theWeb, $theTopic, $meta, 
     588          Foswiki::Func::saveTopic( $theWeb, $theTopic, $meta, 
    589589            $tablesTakenOutText, { dontlog => $doSaveQuiet } ); 
    590590 
    591         TWiki::Func::setTopicEditLock( $theWeb, $theTopic, 0 );   # unlock Topic 
    592         my $url = TWiki::Func::getViewUrl( $theWeb, $theTopic ); 
     591        Foswiki::Func::setTopicEditLock( $theWeb, $theTopic, 0 );   # unlock Topic 
     592        my $url = Foswiki::Func::getViewUrl( $theWeb, $theTopic ); 
    593593        if ($error) { 
    594             $url = TWiki::Func::getOopsUrl( $theWeb, $theTopic, 'oopssaveerr', 
     594            $url = Foswiki::Func::getOopsUrl( $theWeb, $theTopic, 'oopssaveerr', 
    595595                $error ); 
    596596        } 
    597         TWiki::Func::redirectCgiQuery( $query, $url ); 
     597        Foswiki::Func::redirectCgiQuery( $query, $url ); 
    598598        return; 
    599599    } 
     
    610610    my $tmp; 
    611611 
    612     $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'header' ); 
     612    $tmp = Foswiki::Func::extractNameValuePair( $theArgs, 'header' ); 
    613613    $$theHashRef{'header'} = $tmp if ($tmp); 
    614614 
    615     $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'footer' ); 
     615    $tmp = Foswiki::Func::extractNameValuePair( $theArgs, 'footer' ); 
    616616    $$theHashRef{'footer'} = $tmp if ($tmp); 
    617617 
    618     $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'headerislabel' ); 
     618    $tmp = Foswiki::Func::extractNameValuePair( $theArgs, 'headerislabel' ); 
    619619    $$theHashRef{'headerislabel'} = $tmp if ($tmp); 
    620620 
    621     $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'format' ); 
     621    $tmp = Foswiki::Func::extractNameValuePair( $theArgs, 'format' ); 
    622622    $tmp =~ s/^\s*\|*\s*//o; 
    623623    $tmp =~ s/\s*\|*\s*$//o; 
    624624    $$theHashRef{'format'} = $tmp if ($tmp); 
    625625 
    626     $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'changerows' ); 
     626    $tmp = Foswiki::Func::extractNameValuePair( $theArgs, 'changerows' ); 
    627627    $$theHashRef{'changerows'} = $tmp if ($tmp); 
    628628 
    629     $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'quietsave' ); 
     629    $tmp = Foswiki::Func::extractNameValuePair( $theArgs, 'quietsave' ); 
    630630    $$theHashRef{'quietsave'} = $tmp if ($tmp); 
    631631 
    632     $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'helptopic' ); 
     632    $tmp = Foswiki::Func::extractNameValuePair( $theArgs, 'helptopic' ); 
    633633    $$theHashRef{'helptopic'} = $tmp if ($tmp); 
    634634 
    635     $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'editbutton' ); 
     635    $tmp = Foswiki::Func::extractNameValuePair( $theArgs, 'editbutton' ); 
    636636    $$theHashRef{'editbutton'} = $tmp if ($tmp); 
    637637 
    638     $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'javascriptinterface' ); 
     638    $tmp = Foswiki::Func::extractNameValuePair( $theArgs, 'javascriptinterface' ); 
    639639    $$theHashRef{'javascriptinterface'} = $tmp if ($tmp); 
    640640 
    641     $tmp = TWiki::Func::extractNameValuePair( $theArgs, 'buttonrow' ); 
     641    $tmp = Foswiki::Func::extractNameValuePair( $theArgs, 'buttonrow' ); 
    642642    $$theHashRef{'buttonrow'} = $tmp if ($tmp); 
    643643 
     
    662662        $theFormat =~ s/<nop>//gos; 
    663663        $theFormat = 
    664           TWiki::Func::expandCommonVariables( $theFormat, $theTopic, $theWeb ); 
     664          Foswiki::Func::expandCommonVariables( $theFormat, $theTopic, $theWeb ); 
    665665    } 
    666666 
     
    695695 
    696696    # include topic to read definitions 
    697     my $iTopic = TWiki::Func::extractNameValuePair( $theArgs, 'include' ); 
     697    my $iTopic = Foswiki::Func::extractNameValuePair( $theArgs, 'include' ); 
    698698    my $iTopicExists = 0; 
    699699    if ($iTopic) { 
     
    703703        } 
    704704 
    705         $iTopicExists = TWiki::Func::topicExists( $theWeb, $iTopic ) 
     705        $iTopicExists = Foswiki::Func::topicExists( $theWeb, $iTopic ) 
    706706          if $iTopic ne ''; 
    707707        if ( $iTopic && !$iTopicExists ) { 
     
    710710        if ($iTopicExists) { 
    711711 
    712             my $text = TWiki::Func::readTopicText( $theWeb, $iTopic ); 
     712            my $text = Foswiki::Func::readTopicText( $theWeb, $iTopic ); 
    713713            $text =~ /$regex{edit_table_plugin}/os; 
    714714            if ($1) { 
    715715                my $args = $1; 
    716                 if (   $theWeb ne $TWiki::Plugins::EditTablePlugin::web 
    717                     || $iTopic ne $TWiki::Plugins::EditTablePlugin::topic ) 
     716                if (   $theWeb ne $Foswiki::Plugins::EditTablePlugin::web 
     717                    || $iTopic ne $Foswiki::Plugins::EditTablePlugin::topic ) 
    718718                { 
    719719 
    720720                    # expand common vars, unless oneself to prevent recursion 
    721                     $args = TWiki::Func::expandCommonVariables( $1, $iTopic, 
     721                    $args = Foswiki::Func::expandCommonVariables( $1, $iTopic, 
    722722                        $theWeb ); 
    723723                } 
     
    729729    extractParams( $theArgs, \%params ); 
    730730 
    731     # FIXME: should use TWiki::Func::extractParameters 
     731    # FIXME: should use Foswiki::Func::extractParameters 
    732732    $params{'header'} = '' if ( $params{header} =~ /^(off|no)$/oi ); 
    733733    $params{'header'} =~ s/^\s*\|//o; 
     
    760760      = @_; 
    761761 
    762     my $viewUrl = TWiki::Func::getScriptUrl( $theWeb, $theTopic, 'viewauth' ) 
     762    my $viewUrl = Foswiki::Func::getScriptUrl( $theWeb, $theTopic, 'viewauth' ) 
    763763      . "\#edittable$theTableNr"; 
    764764    my $text = ''; 
    765765    if ($doEdit) { 
    766         require TWiki::Contrib::JSCalendarContrib; 
     766        require Foswiki::Contrib::JSCalendarContrib; 
    767767        unless ($@) { 
    768             TWiki::Contrib::JSCalendarContrib::addHEAD('twiki'); 
     768            Foswiki::Contrib::JSCalendarContrib::addHEAD('twiki'); 
    769769        } 
    770770    } 
     
    791791    # pass to javascript (through META tag vars) how many header rows 
    792792    # and footer rows we have 
    793     &TWiki::Plugins::EditTablePlugin::addHeaderAndFooterCountToHead( 
     793    &Foswiki::Plugins::EditTablePlugin::addHeaderAndFooterCountToHead( 
    794794        $headerRowCount, $footerRowCount ) 
    795795      if ( $doEdit 
     
    868868            } 
    869869            my $helpText = 
    870               TWiki::Func::readTopicText( $theWeb, $params{'helptopic'} ); 
     870              Foswiki::Func::readTopicText( $theWeb, $params{'helptopic'} ); 
    871871 
    872872            #Strip out the meta data so it won't be displayed. 
     
    881881        # table specific script 
    882882        my $tableNr = $query->param('ettablenr'); 
    883         &TWiki::Plugins::EditTablePlugin::addEditModeHeadersToHead( $tableNr, 
     883        &Foswiki::Plugins::EditTablePlugin::addEditModeHeadersToHead( $tableNr, 
    884884            $params{'javascriptinterface'} ); 
    885         &TWiki::Plugins::EditTablePlugin::addJavaScriptInterfaceDisabledToHead( 
     885        &Foswiki::Plugins::EditTablePlugin::addJavaScriptInterfaceDisabledToHead( 
    886886            $tableNr) 
    887887          if ( $params{'javascriptinterface'} eq 'off' ); 
    888         &TWiki::Plugins::EditTablePlugin::addJavaScriptInterfaceDisabledToHead( 
     888        &Foswiki::Plugins::EditTablePlugin::addJavaScriptInterfaceDisabledToHead( 
    889889            $tableNr) 
    890890          if ( $params{'changerows'} eq '' ); 
     
    913913 
    914914sub parseEditCellFormat { 
    915     $_[1] = TWiki::Func::extractNameValuePair( $_[0] ); 
     915    $_[1] = Foswiki::Func::extractNameValuePair( $_[0] ); 
    916916    return ''; 
    917917} 
     
    923923sub viewEditCell { 
    924924    my ($theAttr) = @_; 
    925     $theAttr = TWiki::Func::extractNameValuePair($theAttr); 
     925    $theAttr = Foswiki::Func::extractNameValuePair($theAttr); 
    926926    return '' unless ( $theAttr =~ /^editbutton/ ); 
    927927 
     
    10141014    if ( $type eq 'select' ) { 
    10151015        my $expandedValue = 
    1016           TWiki::Func::expandCommonVariables( $theValue, $theTopic, $theWeb ); 
     1016          Foswiki::Func::expandCommonVariables( $theValue, $theTopic, $theWeb ); 
    10171017        $size = 1 if $size < 1; 
    10181018        $text = 
     
    10411041    elsif ( $type eq "radio" ) { 
    10421042        my $expandedValue = 
    1043           &TWiki::Func::expandCommonVariables( $theValue, $theTopic, $theWeb ); 
     1043          &Foswiki::Func::expandCommonVariables( $theValue, $theTopic, $theWeb ); 
    10441044        $size = 1 if $size < 1; 
    10451045        my $elements = ( @bits - 2 ); 
     
    10801080    elsif ( $type eq "checkbox" ) { 
    10811081        my $expandedValue = 
    1082           &TWiki::Func::expandCommonVariables( $theValue, $theTopic, $theWeb ); 
     1082          &Foswiki::Func::expandCommonVariables( $theValue, $theTopic, $theWeb ); 
    10831083        $size = 1 if $size < 1; 
    10841084        my $elements = ( @bits - 2 ); 
     
    11451145        unless ( defined $table and $digestedCellValue ) { 
    11461146 
    1147             # To deal with the situation where TWiki variables, like 
     1147            # To deal with the situation where Foswiki variables, like 
    11481148            # %CALC%, have already been processed and end up getting saved 
    11491149            # in the table that way (processed), we need to read in the 
    11501150            # topic page in raw format 
    1151             my $topicContents = TWiki::Func::readTopicText( 
    1152                 $TWiki::Plugins::EditTablePlugin::web, 
    1153                 $TWiki::Plugins::EditTablePlugin::topic 
     1151            my $topicContents = Foswiki::Func::readTopicText( 
     1152                $Foswiki::Plugins::EditTablePlugin::web, 
     1153                $Foswiki::Plugins::EditTablePlugin::topic 
    11541154            ); 
    1155             $table = TWiki::Plugins::EditTable->new(); 
     1155            $table = Foswiki::Plugins::EditTable->new(); 
    11561156            $table->parseText($topicContents); 
    11571157        } 
     
    11611161          : $rawValue; 
    11621162        $theValue = $cell if ( defined $cell );    # original value from file 
    1163         TWiki::Plugins::EditTablePlugin::encodeValue($theValue) 
     1163        Foswiki::Plugins::EditTablePlugin::encodeValue($theValue) 
    11641164          unless ( $theValue eq '' ); 
    11651165 
     
    11741174        $rows |= 3  if !defined $rows; 
    11751175        $cols |= 30 if !defined $cols; 
    1176         TWiki::Plugins::EditTablePlugin::encodeValue($theValue) 
     1176        Foswiki::Plugins::EditTablePlugin::encodeValue($theValue) 
    11771177          unless ( $theValue eq '' ); 
    11781178        $text .= 
     
    11841184        my $ifFormat = ''; 
    11851185        $ifFormat = $bits[3] if ( @bits > 3 ); 
    1186         $ifFormat ||= $TWiki::cfg{JSCalendarContrib}{format} || '%e %B %Y'; 
     1186        $ifFormat ||= $Foswiki::cfg{JSCalendarContrib}{format} || '%e %B %Y'; 
    11871187        $size = 10 if ( !$size || $size < 1 ); 
    1188         TWiki::Plugins::EditTablePlugin::encodeValue($theValue) 
     1188        Foswiki::Plugins::EditTablePlugin::encodeValue($theValue) 
    11891189          unless ( $theValue eq '' ); 
    11901190        $text .= CGI::textfield( 
     
    11991199        ); 
    12001200        $text .= saveEditCellFormat( $cellFormat, $theName ); 
    1201         eval 'use TWiki::Contrib::JSCalendarContrib'; 
     1201        eval 'use Foswiki::Contrib::JSCalendarContrib'; 
    12021202 
    12031203        unless ($@) { 
     
    12071207                -name    => 'calendar', 
    12081208                -onclick => "return showCalendar('id$theName','$ifFormat')", 
    1209                 -src     => TWiki::Func::getPubUrlPath() . '/' 
    1210                   . TWiki::Func::getTwikiWebname() 
     1209                -src     => Foswiki::Func::getPubUrlPath() . '/' 
     1210                  . Foswiki::Func::getTwikiWebname() 
    12111211                  . '/JSCalendarContrib/img.gif', 
    12121212                -alt   => 'Calendar', 
     
    12191219    else {    #  if( $type eq 'text') 
    12201220        $size = $DEFAULT_FIELD_SIZE if $size < 1; 
    1221         TWiki::Plugins::EditTablePlugin::encodeValue($theValue) 
     1221        Foswiki::Plugins::EditTablePlugin::encodeValue($theValue) 
    12221222          unless ( $theValue eq '' ); 
    12231223        $text = 
     
    13771377 
    13781378    # render final value in view mode (not edit or save) 
    1379     TWiki::Plugins::EditTablePlugin::decodeFormatTokens($text) 
     1379    Foswiki::Plugins::EditTablePlugin::decodeFormatTokens($text) 
    13801380      if ( !$doSave && !$doEdit ); 
    13811381 
     
    14101410    my ( $theWeb, $theTopic ) = @_; 
    14111411 
    1412     TWiki::Func::writeDebug( 
     1412    Foswiki::Func::writeDebug( 
    14131413        "- EditTablePlugin::doCancelEdit( $theWeb, $theTopic )") 
    1414       if $TWiki::Plugins::EditTablePlugin::debug; 
    1415  
    1416     TWiki::Func::setTopicEditLock( $theWeb, $theTopic, 0 ); 
    1417  
    1418     TWiki::Func::redirectCgiQuery( $query, 
    1419         TWiki::Func::getViewUrl( $theWeb, $theTopic ) ); 
     1414      if $Foswiki::Plugins::EditTablePlugin::debug; 
     1415 
     1416    Foswiki::Func::setTopicEditLock( $theWeb, $theTopic, 0 ); 
     1417 
     1418    Foswiki::Func::redirectCgiQuery( $query, 
     1419        Foswiki::Func::getViewUrl( $theWeb, $theTopic ) ); 
    14201420} 
    14211421 
     
    14271427    my ( $theWeb, $theTopic, $doCheckIfLocked ) = @_; 
    14281428 
    1429     TWiki::Func::writeDebug( 
     1429    Foswiki::Func::writeDebug( 
    14301430        "- EditTablePlugin::doEnableEdit( $theWeb, $theTopic )") 
    1431       if $TWiki::Plugins::EditTablePlugin::debug; 
    1432  
    1433     my $wikiUserName = TWiki::Func::getWikiName(); 
     1431      if $Foswiki::Plugins::EditTablePlugin::debug; 
     1432 
     1433    my $wikiUserName = Foswiki::Func::getWikiName(); 
    14341434    if ( 
    1435         !TWiki::Func::checkAccessPermission( 
     1435        !Foswiki::Func::checkAccessPermission( 
    14361436            'change', $wikiUserName, undef, $theTopic, $theWeb 
    14371437        ) 
     
    14401440 
    14411441        # user has no permission to change the topic 
    1442         throw TWiki::OopsException( 
     1442        throw Foswiki::OopsException( 
    14431443            'accessdenied', 
    14441444            def    => 'topic_access', 
     
    14521452    unless ($breakLock) { 
    14531453        my ( $oopsUrl, $lockUser ) = 
    1454           TWiki::Func::checkTopicEditLock( $theWeb, $theTopic, 'view' ); 
     1454          Foswiki::Func::checkTopicEditLock( $theWeb, $theTopic, 'view' ); 
    14551455        if ($oopsUrl) { 
    1456             my $loginUser = TWiki::Func::wikiToUserName($wikiUserName); 
     1456            my $loginUser = Foswiki::Func::wikiToUserName($wikiUserName); 
    14571457            if ( $lockUser ne $loginUser ) { 
    14581458 
     
    14631463                # add info of the edited table 
    14641464                my $params = ''; 
    1465                 $query = TWiki::Func::getCgiQuery(); 
     1465                $query = Foswiki::Func::getCgiQuery(); 
    14661466                $params .= ';ettablenr=' . $query->param('ettablenr'); 
    14671467                $params .= ';etedit=on'; 
     
    14691469 
    14701470                # warn user that other person is editing this topic 
    1471                 TWiki::Func::redirectCgiQuery( $query, $oopsUrl ); 
     1471                Foswiki::Func::redirectCgiQuery( $query, $oopsUrl ); 
    14721472                return 0; 
    14731473            } 
     
    14761476 
    14771477    # We are allowed to edit 
    1478     TWiki::Func::setTopicEditLock( $theWeb, $theTopic, 1 ); 
     1478    Foswiki::Func::setTopicEditLock( $theWeb, $theTopic, 1 ); 
    14791479 
    14801480    return 1; 
     
    15021502=cut 
    15031503 
    1504 package TWiki::Plugins::EditTable; 
     1504package Foswiki::Plugins::EditTable; 
    15051505 
    15061506use vars qw( 
     
    15861586 
    15871587                # EDITTABLE and TABLE on one line (order does not matter) 
    1588                 TWiki::Plugins::EditTablePlugin::Core::putTmpTagInTableTagLine( 
     1588                Foswiki::Plugins::EditTablePlugin::Core::putTmpTagInTableTagLine( 
    15891589                    $_); 
    15901590                $inEditTable = 1; 
     
    16001600 
    16011601# store the TABLE tag from the previous line together with the current EDITTABLE tag 
    1602                     TWiki::Plugins::EditTablePlugin::Core::putTmpTagInTableTagLine( 
     1602                    Foswiki::Plugins::EditTablePlugin::Core::putTmpTagInTableTagLine( 
    16031603                        $storedTableRow); 
    16041604                    $editTableTag .= $storedTableRow . "\n"; 
     
    16151615                # TABLE on the line after EDITTABLE 
    16161616                # we will include it in the editTableTag 
    1617                 TWiki::Plugins::EditTablePlugin::Core::putTmpTagInTableTagLine( 
     1617                Foswiki::Plugins::EditTablePlugin::Core::putTmpTagInTableTagLine( 
    16181618                    $_); 
    16191619                $doCopyLine = 0; 
Note: See TracChangeset for help on using the changeset viewer.