Changeset 811


Ignore:
Timestamp:
11/19/08 15:00:00 (3 years ago)
Author:
CrawfordCurrie
Message:

Item175: port a subset of the standard extensions over to the new namespace to make a working system with mixed TWiki and Foswiki plugins

Location:
trunk
Files:
3 added
73 edited
36 moved

Legend:

Unmodified
Added
Removed
  • trunk/BehaviourContrib/lib/Foswiki/Contrib/BehaviourContrib.pm

    r464 r811  
    1 package TWiki::Contrib::BehaviourContrib; 
     1package Foswiki::Contrib::BehaviourContrib; 
    22use vars qw( $VERSION ); 
    33$VERSION = '$Rev$'; 
     
    66=begin twiki 
    77 
    8 ---+++ TWiki::Contrib::BehaviourContrib::addHEAD() 
     8---+++ Foswiki::Contrib::BehaviourContrib::addHEAD() 
    99 
    1010This function will automatically add the headers for the contrib to 
     
    1515sub commonTagsHandler { 
    1616  .... 
    17   require TWiki::Contrib::BehaviourContrib; 
    18   TWiki::Contrib::BehaviourContrib::addHEAD(); 
     17  require Foswiki::Contrib::BehaviourContrib; 
     18  Foswiki::Contrib::BehaviourContrib::addHEAD(); 
    1919  .... 
    2020</verbatim> 
     
    2525    my $base = '%PUBURLPATH%/%SYSTEMWEB%/BehaviourContrib'; 
    2626    my $USE_SRC = 
    27       TWiki::Func::getPreferencesValue('BEHAVIOURCONTRIB_DEBUG') ? 
     27      Foswiki::Func::getPreferencesValue('BEHAVIOURCONTRIB_DEBUG') ? 
    2828          '_src' : ''; 
    2929    my $head = <<HERE; 
    3030<script type='text/javascript' src='$base/behaviour$USE_SRC.js'></script> 
    3131HERE 
    32     TWiki::Func::addToHEAD( 'BEHAVIOURCONTRIB', $head ); 
     32    Foswiki::Func::addToHEAD( 'BEHAVIOURCONTRIB', $head ); 
    3333} 
    3434 
  • trunk/BehaviourContrib/lib/Foswiki/Contrib/BehaviourContrib/MANIFEST

    r14 r811  
    1 pub/TWiki/BehaviourContrib/behaviour_src.js 0644 
    2 pub/TWiki/BehaviourContrib/behaviour.js 0644 
    3 pub/TWiki/BehaviourContrib/behaviour.compressed_src.js 0644 
    4 pub/TWiki/BehaviourContrib/behaviour.compressed.js 0644 
    5 data/TWiki/BehaviourContrib.txt 0644 
    6 lib/TWiki/Contrib/BehaviourContrib.pm 0644 
     1pub/System/BehaviourContrib/behaviour_src.js 0644 
     2pub/System/BehaviourContrib/behaviour.js 0644 
     3pub/System/BehaviourContrib/behaviour.compressed_src.js 0644 
     4pub/System/BehaviourContrib/behaviour.compressed.js 0644 
     5data/System/BehaviourContrib.txt 0644 
     6lib/Foswiki/Contrib/BehaviourContrib.pm 0644 
  • trunk/BehaviourContrib/lib/Foswiki/Contrib/BehaviourContrib/build.pl

    r14 r811  
    99} 
    1010 
    11 use TWiki::Contrib::Build; 
     11use Foswiki::Contrib::Build; 
    1212 
    1313# Create the build object 
    14 $build = new TWiki::Contrib::Build( 'BehaviourContrib' ); 
     14$build = new Foswiki::Contrib::Build( 'BehaviourContrib' ); 
    1515 
    1616# Build the target on the command line, or the default target 
  • trunk/CommentPlugin/lib/Foswiki/Plugins/CommentPlugin.pm

    r781 r811  
    22# 
    33# Copyright (C) 2004 Crawford Currie 
    4 # Copyright (C) 2001-2006 TWiki Contributors. All Rights Reserved. 
    5 # TWiki Contributors 
     4# Copyright (C) 2001-2006 Foswiki Contributors. All Rights Reserved. 
     5# Foswiki Contributors 
    66# are listed in the AUTHORS file in the root of this distribution. 
    77# NOTE: Please extend that file, not this notice. 
     
    2121# See Plugin topic for history and plugin information 
    2222 
    23 package TWiki::Plugins::CommentPlugin; 
     23package Foswiki::Plugins::CommentPlugin; 
    2424 
    2525use strict; 
    2626 
    27 require TWiki::Func; 
    28 require TWiki::Plugins; 
     27require Foswiki::Func; 
     28require Foswiki::Plugins; 
    2929 
    3030use vars qw( $VERSION $RELEASE $SHORTDESCRIPTION $NO_PREFS_IN_TOPIC ); 
     
    4545    #my ( $topic, $web, $user, $installWeb ) = @_; 
    4646 
    47     if( $TWiki::Plugins::VERSION < 1.026 ) { 
    48         TWiki::Func::writeWarning( "CommentPlugin $VERSION requires TWiki::Plugins::VERSION >= 1.026, $TWiki::Plugins::VERSION found." ); 
     47    if( $Foswiki::Plugins::VERSION < 1.026 ) { 
     48        Foswiki::Func::writeWarning( "CommentPlugin $VERSION requires Foswiki::Plugins::VERSION >= 1.026, $Foswiki::Plugins::VERSION found." ); 
    4949        return 0; 
    5050    } 
     
    5656    my ( $text, $topic, $web, $meta ) = @_; 
    5757 
    58     require TWiki::Plugins::CommentPlugin::Comment; 
     58    require Foswiki::Plugins::CommentPlugin::Comment; 
    5959 
    60     my $query = TWiki::Func::getCgiQuery(); 
     60    my $query = Foswiki::Func::getCgiQuery(); 
    6161    return unless( defined( $query )); 
    6262 
     
    6767    # SMELL: unreliable 
    6868    my $previewing = ($scriptname =~ /\/(preview|gnusave|rdiff)/); 
    69     TWiki::Plugins::CommentPlugin::Comment::prompt( $previewing, 
     69    Foswiki::Plugins::CommentPlugin::Comment::prompt( $previewing, 
    7070                                                    $_[0], $web, $topic ); 
    7171} 
     
    7474    #my ( $text, $topic, $web ) = @_; 
    7575 
    76     require TWiki::Plugins::CommentPlugin::Comment; 
     76    require Foswiki::Plugins::CommentPlugin::Comment; 
    7777 
    78     my $query = TWiki::Func::getCgiQuery(); 
     78    my $query = Foswiki::Func::getCgiQuery(); 
    7979    return unless $query; 
    8080 
     
    8282 
    8383    return unless( defined( $action ) && $action eq 'save' ); 
    84     TWiki::Plugins::CommentPlugin::Comment::save( @_ ); 
     84    Foswiki::Plugins::CommentPlugin::Comment::save( @_ ); 
    8585} 
    8686 
  • trunk/CommentPlugin/lib/Foswiki/Plugins/CommentPlugin/Comment.pm

    r781 r811  
    22# 
    33# Copyright (C) 2004 Crawford Currie 
    4 # Copyright (C) 2001-2006 TWiki Contributors. 
    5 # All Rights Reserved. TWiki Contributors 
     4# Copyright (C) 2001-2006 Foswiki Contributors. 
     5# All Rights Reserved. Foswiki Contributors 
    66# are listed in the AUTHORS file in the root of this distribution. 
    77# NOTE: Please extend that file, not this notice. 
     
    2323# and again by Crawford Currie 
    2424# 
    25 # This version is specific to TWiki::Plugins::VERSION > 1.026 
     25# This version is specific to Foswiki::Plugins::VERSION > 1.026 
    2626 
    2727use strict; 
    2828 
    29 use TWiki; 
    30 use TWiki::Plugins; 
    31 use TWiki::Store; 
    32 use TWiki::Attrs; 
     29use Foswiki; 
     30use Foswiki::Plugins; 
     31use Foswiki::Store; 
     32use Foswiki::Attrs; 
    3333use CGI qw( -any ); 
    3434 
    35 package TWiki::Plugins::CommentPlugin::Comment; 
     35package Foswiki::Plugins::CommentPlugin::Comment; 
    3636 
    3737# PUBLIC save the given comment. 
     
    3939    #my ( $text, $topic, $web ) = @_; 
    4040 
    41     my $wikiName = TWiki::Func::getWikiName(); 
    42     if( ! TWiki::Func::checkAccessPermission( 'change', $wikiName, '', 
     41    my $wikiName = Foswiki::Func::getWikiName(); 
     42    if( ! Foswiki::Func::checkAccessPermission( 'change', $wikiName, '', 
    4343                                                                                          $_[1], $_[2] ) ) { 
    4444        # user has no permission to change the topic 
    45         throw TWiki::OopsException( 'accessdenied', 
     45        throw Foswiki::OopsException( 'accessdenied', 
    4646                                    def => 'topic_access', 
    4747                                    web => $_[2], 
     
    5656    #my ( $previewing, $text, $web, $topic ) = @_; 
    5757 
    58     my $defaultType = TWiki::Func::getPreferencesValue('COMMENTPLUGIN_DEFAULT_TYPE') || 'above'; 
     58    my $defaultType = Foswiki::Func::getPreferencesValue('COMMENTPLUGIN_DEFAULT_TYPE') || 'above'; 
    5959 
    6060    my $message = ''; 
     
    8484    if ( $attrtemplatetopic ) { 
    8585        my ($templocweb, $temploctopic ) = 
    86           TWiki::Func::normalizeWebTopicName($templateweb, $attrtemplatetopic); 
     86          Foswiki::Func::normalizeWebTopicName($templateweb, $attrtemplatetopic); 
    8787        $templatetopic = "$templocweb.$temploctopic"; 
    8888    } 
     
    9797    $attributes =~ s/^{(.*)}$/$1/ if ( $attributes ); 
    9898 
    99     my $attrs = new TWiki::Attrs( $attributes, 1 ); 
     99    my $attrs = new Foswiki::Attrs( $attributes, 1 ); 
    100100    my $type = 
    101101      $attrs->remove( 'type' ) || $attrs->remove( 'mode' ) || $defaultType; 
     
    143143    my $url = ''; 
    144144    if ( $disable eq '' ) { 
    145         $url = TWiki::Func::getScriptUrl( $web, $topic, 'save' ); 
     145        $url = Foswiki::Func::getScriptUrl( $web, $topic, 'save' ); 
    146146    } 
    147147 
     
    213213    # Get the templates. 
    214214    my $templateFile = $templatetopic 
    215         || TWiki::Func::getPreferencesValue('COMMENTPLUGIN_TEMPLATES') 
     215        || Foswiki::Func::getPreferencesValue('COMMENTPLUGIN_TEMPLATES') 
    216216        || 'comments'; 
    217217 
    218218    my $templates = 
    219       TWiki::Func::loadTemplate( $templateFile ); 
     219      Foswiki::Func::loadTemplate( $templateFile ); 
    220220    if (! $templates ) { 
    221         TWiki::Func::writeWarning("Could not read template file '$templateFile'"); 
     221        Foswiki::Func::writeWarning("Could not read template file '$templateFile'"); 
    222222        return; 
    223223    } 
    224224 
    225     my $t = TWiki::Func::expandTemplate( $name ); 
     225    my $t = Foswiki::Func::expandTemplate( $name ); 
    226226    return "%RED%No such template def TMPL:DEF{$name}%ENDCOLOR%" 
    227227      unless ( defined($t) && $t ne '' ) || $warn eq 'off'; 
     
    244244    my ( $topic, $web ) = ( $_[1], $_[2] ); 
    245245 
    246     my $query = TWiki::Func::getCgiQuery(); 
     246    my $query = Foswiki::Func::getCgiQuery(); 
    247247    return unless $query; 
    248248 
    249249    my $type = $query->param( 'comment_type' ) || 
    250       TWiki::Func::getPreferencesValue('COMMENTPLUGIN_DEFAULT_TYPE') || 
     250      Foswiki::Func::getPreferencesValue('COMMENTPLUGIN_DEFAULT_TYPE') || 
    251251          'below'; 
    252252    my $index = $query->param( 'comment_index' ) || 0; 
     
    270270    # Expand common variables in the template, but don't expand other 
    271271    # tags. 
    272     $output = TWiki::Func::expandVariablesOnTopicCreation($output); 
     272    $output = Foswiki::Func::expandVariablesOnTopicCreation($output); 
    273273 
    274274    $output = '' unless defined($output); 
  • trunk/CommentPlugin/lib/Foswiki/Plugins/CommentPlugin/MANIFEST

    r14 r811  
    1 data/TWiki/CommentPlugin.txt 0644 Plugin doc page 
    2 data/TWiki/VarCOMMENT.txt 0644 Comment tag doc page 
    3 data/TWiki/CommentPluginTemplate.txt 0644 Standard templates 
    4 data/TWiki/CommentPluginExamples.txt 0644 Examples of standard templates 
     1data/System/CommentPlugin.txt 0644 Plugin doc page 
     2data/System/VarCOMMENT.txt 0644 Comment tag doc page 
     3data/System/CommentPluginTemplate.txt 0644 Standard templates 
     4data/System/CommentPluginExamples.txt 0644 Examples of standard templates 
    55data/Sandbox/CommentPluginExampleComments.txt 0644 Examples of target comment 
    66data/Sandbox/CommentPluginTemplateExample.txt 0644 Example of comment template topic 
    77templates/comments.tmpl 0444 Master comment templates  
    8 lib/TWiki/Plugins/CommentPlugin.pm 0444 Plugin Perl module  
    9 lib/TWiki/Plugins/CommentPlugin/Comment.pm 0444 Plugin Perl module  
     8lib/Foswiki/Plugins/CommentPlugin.pm 0444 Plugin Perl module  
     9lib/Foswiki/Plugins/CommentPlugin/Comment.pm 0444 Plugin Perl module  
    1010 
    11 pub/TWiki/CommentPlugin/wikiringlogo20x20.png 0660 
     11pub/System/CommentPlugin/wikiringlogo20x20.png 0660 
  • trunk/CommentPlugin/lib/Foswiki/Plugins/CommentPlugin/build.pl

    r14 r811  
    88    } 
    99} 
    10 use TWiki::Contrib::Build; 
     10use Foswiki::Contrib::Build; 
    1111 
    12 @CommentPluginBuild::ISA = ( "TWiki::Contrib::Build" ); 
     12@CommentPluginBuild::ISA = ( "Foswiki::Contrib::Build" ); 
    1313 
    1414sub new { 
  • trunk/CommentPlugin/test/unit/CommentPlugin/CommentPluginTests.pm

    r14 r811  
    88use Unit::Request; 
    99use Unit::Response; 
    10 use TWiki; 
    11 use TWiki::UI::Save; 
    12 use TWiki::Plugins::CommentPlugin; 
    13 use TWiki::Plugins::CommentPlugin::Comment; 
     10use Foswiki; 
     11use Foswiki::UI::Save; 
     12use Foswiki::Plugins::CommentPlugin; 
     13use Foswiki::Plugins::CommentPlugin::Comment; 
    1414use CGI; 
    1515 
     
    3434sub writeTopic { 
    3535    my( $this, $web, $topic, $text ) = @_; 
    36     my $meta = new TWiki::Meta($this->{twiki}, $web, $topic); 
     36    my $meta = new Foswiki::Meta($this->{twiki}, $web, $topic); 
    3737    $this->{twiki}->{store}->saveTopic( 
    3838        $this->{twiki}->{user}, $web, $topic, $text, $meta ); 
     
    6969    } 
    7070 
    71     my $url = "$TWiki::cfg{DefaultUrlHost}$TWiki::cfg{ScriptUrlPath}/save$TWiki::cfg{ScriptSuffix}/$web/$topic"; 
     71    my $url = "$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{ScriptUrlPath}/save$Foswiki::cfg{ScriptSuffix}/$web/$topic"; 
    7272 
    7373    if ( $location ) { 
     
    103103    my $pidx = $eidx; 
    104104    my $html = 
    105       TWiki::Plugins::CommentPlugin::Comment::_handleInput( 
     105      Foswiki::Plugins::CommentPlugin::Comment::_handleInput( 
    106106          $sattrs, 
    107107          $this->{test_web}, 
     
    196196    } 
    197197 
    198     my $session = new TWiki( $TWiki::cfg{DefaultUserLoginName}, $query); 
     198    my $session = new Foswiki( $Foswiki::cfg{DefaultUserLoginName}, $query); 
    199199    my $text = "Ignore this text"; 
    200200 
    201201    # invoke the save handler 
    202     $this->capture(\&TWiki::UI::Save::save, $session ); 
    203  
    204     $text = TWiki::Func::readTopicText($web, $topic); 
     202    $this->capture(\&Foswiki::UI::Save::save, $session ); 
     203 
     204    $text = Foswiki::Func::readTopicText($web, $topic); 
    205205    $this->assert_matches(qr/$comm/, $text, "$web.$topic: $text"); 
    206206 
     
    278278    my $pidx = 0; 
    279279    my $html = 
    280       TWiki::Plugins::CommentPlugin::Comment::_handleInput 
     280      Foswiki::Plugins::CommentPlugin::Comment::_handleInput 
    281281          ("rows=99 cols=104 mode=after button=HoHo id=sausage",, 
    282282           $this->{test_topic}, 
     
    296296    my $pidx = 0; 
    297297    my $html = 
    298       TWiki::Plugins::CommentPlugin::Comment::_handleInput 
     298      Foswiki::Plugins::CommentPlugin::Comment::_handleInput 
    299299          ("target=\"$this->{test_web}.ATopic#AAnchor\" location=\"AnRE\"", 
    300300           $this->{test_topic}, 
     
    318318    my $pidx = 0; 
    319319    my $html = 
    320       TWiki::Plugins::CommentPlugin::Comment::_handleInput( 
     320      Foswiki::Plugins::CommentPlugin::Comment::_handleInput( 
    321321          'nopost="on"', 
    322322          $this->{test_web}, 
     
    339339    $query->path_info("/$this->{test_web}/$this->{test_topic}"); 
    340340 
    341     my $session = new TWiki( $TWiki::cfg{DefaultUserLoginName}, $query); 
     341    my $session = new Foswiki( $Foswiki::cfg{DefaultUserLoginName}, $query); 
    342342    my $text = "Ignore this text"; 
    343343 
    344344    # invoke the save handler 
    345     $this->capture(\&TWiki::UI::Save::save, $session ); 
    346  
    347     $text = TWiki::Func::readTopicText($this->{test_web}, $this->{test_topic}); 
     345    $this->capture(\&Foswiki::UI::Save::save, $session ); 
     346 
     347    $text = Foswiki::Func::readTopicText($this->{test_web}, $this->{test_topic}); 
    348348    # make sure it hasn't changed 
    349349    $text =~ s/^%META.*?\n//gm; 
     
    362362    my $pidx = 99; 
    363363    my $html = 
    364       TWiki::Plugins::CommentPlugin::Comment::_handleInput( 
     364      Foswiki::Plugins::CommentPlugin::Comment::_handleInput( 
    365365          'remove="on"', 
    366366          $this->{test_web}, 
     
    384384    $query->path_info("/$this->{test_web}/$this->{test_topic}"); 
    385385 
    386     my $session = new TWiki( $TWiki::cfg{DefaultUserLoginName}, $query); 
     386    my $session = new Foswiki( $Foswiki::cfg{DefaultUserLoginName}, $query); 
    387387    my $text = "Ignore this text"; 
    388388 
    389389    # invoke the save handler 
    390     $this->capture(\&TWiki::UI::Save::save, $session ); 
    391  
    392     $text = TWiki::Func::readTopicText($this->{test_web}, $this->{test_topic}); 
     390    $this->capture(\&Foswiki::UI::Save::save, $session ); 
     391 
     392    $text = Foswiki::Func::readTopicText($this->{test_web}, $this->{test_topic}); 
    393393    # make sure it hasn't changed 
    394394    $text =~ s/^%META.*?\n//gm; 
     
    411411    my $pidx = 99; 
    412412    my $html = 
    413       TWiki::Plugins::CommentPlugin::Comment::_handleInput( 
     413      Foswiki::Plugins::CommentPlugin::Comment::_handleInput( 
    414414          'default="wibble"', 
    415415          $this->{test_web}, 
  • trunk/EmptyPlugin/lib/Foswiki/Plugins/EmptyPlugin.pm

    r781 r811  
    33# Copyright (C) 2000-2003 Andrea Sterbini, a.sterbini@flashnet.it 
    44# Copyright (C) 2001-2006 Peter Thoeny, peter@thoeny.org 
    5 # and TWiki Contributors. All Rights Reserved. TWiki Contributors 
     5# and Foswiki Contributors. All Rights Reserved. Foswiki Contributors 
    66# are listed in the AUTHORS file in the root of this distribution. 
    77# NOTE: Please extend that file, not this notice. 
     
    2828 
    2929This version of the !EmptyPlugin documents the handlers supported 
    30 by revision 1.2 of the Plugins API. See the documentation of =TWiki::Func= 
     30by revision 1.2 of the Plugins API. See the documentation of =Foswiki::Func= 
    3131for more information about what this revision number means, and how a 
    3232plugin can check it. 
    3333 
    3434__NOTE:__ To interact with TWiki use ONLY the official API functions 
    35 in the TWiki::Func module. Do not reference any functions or 
     35in the Foswiki::Func module. Do not reference any functions or 
    3636variables elsewhere in TWiki, as these are subject to change 
    3737without prior warning, and your plugin may suddenly stop 
     
    6464 
    6565# change the package name and $pluginName!!! 
    66 package TWiki::Plugins::EmptyPlugin; 
     66package Foswiki::Plugins::EmptyPlugin; 
    6767 
    6868# Always use strict to enforce variable scoping 
    6969use strict; 
    7070 
    71 require TWiki::Func;    # The plugins API 
    72 require TWiki::Plugins; # For the API version 
     71require Foswiki::Func;    # The plugins API 
     72require Foswiki::Plugins; # For the API version 
    7373 
    7474# $VERSION is referred to by TWiki, and is the only global variable that 
     
    9393# stored in the plugin topic. This default is required for compatibility with 
    9494# older plugins, but imposes a significant performance penalty, and 
    95 # is not recommended. Instead, use $TWiki::cfg entries set in LocalSite.cfg, or 
     95# is not recommended. Instead, use $Foswiki::cfg entries set in LocalSite.cfg, or 
    9696# if you want the users to be able to change settings, then use standard TWiki 
    9797# preferences that can be defined in your %USERSWEB%.SitePreferences and overridden 
     
    114114Called to initialise the plugin. If everything is OK, should return 
    115115a non-zero value. On non-fatal failure, should write a message 
    116 using TWiki::Func::writeWarning and return 0. In this case 
     116using Foswiki::Func::writeWarning and return 0. In this case 
    117117%FAILEDPLUGINS% will indicate which plugins failed. 
    118118 
     
    121121will be trapped and reported in the browser. 
    122122 
    123 You may also call =TWiki::Func::registerTagHandler= here to register 
     123You may also call =Foswiki::Func::registerTagHandler= here to register 
    124124a function to handle variables that have standard TWiki syntax - for example, 
    125125=%MYTAG{"my param" myarg="My Arg"}%. You can also override internal 
     
    138138 
    139139    # check for Plugins.pm versions 
    140     if( $TWiki::Plugins::VERSION < 1.026 ) { 
    141         TWiki::Func::writeWarning( "Version mismatch between $pluginName and Plugins.pm" ); 
     140    if( $Foswiki::Plugins::VERSION < 1.026 ) { 
     141        Foswiki::Func::writeWarning( "Version mismatch between $pluginName and Plugins.pm" ); 
    142142        return 0; 
    143143    } 
     
    147147 
    148148    # Set plugin preferences in LocalSite.cfg, like this: 
    149     # $TWiki::cfg{Plugins}{EmptyPlugin}{ExampleSetting} = 1; 
     149    # $Foswiki::cfg{Plugins}{EmptyPlugin}{ExampleSetting} = 1; 
    150150    # Always provide a default in case the setting is not defined in 
    151151    # LocalSite.cfg. See %SYSTEMWEB%.Plugins for help in adding your plugin 
    152152    # configuration to the =configure= interface. 
    153     my $setting = $TWiki::cfg{Plugins}{EmptyPlugin}{ExampleSetting} || 0; 
    154     $debug = $TWiki::cfg{Plugins}{EmptyPlugin}{Debug} || 0; 
     153    my $setting = $Foswiki::cfg{Plugins}{EmptyPlugin}{ExampleSetting} || 0; 
     154    $debug = $Foswiki::cfg{Plugins}{EmptyPlugin}{Debug} || 0; 
    155155 
    156156    # register the _EXAMPLETAG function to handle %EXAMPLETAG{...}% 
    157157    # This will be called whenever %EXAMPLETAG% or %EXAMPLETAG{...}% is 
    158158    # seen in the topic text. 
    159     TWiki::Func::registerTagHandler( 'EXAMPLETAG', \&_EXAMPLETAG ); 
     159    Foswiki::Func::registerTagHandler( 'EXAMPLETAG', \&_EXAMPLETAG ); 
    160160 
    161161    # Allow a sub to be called from the REST interface  
    162162    # using the provided alias 
    163     TWiki::Func::registerRESTHandler('example', \&restExample); 
     163    Foswiki::Func::registerRESTHandler('example', \&restExample); 
    164164 
    165165    # Plugin correctly initialized 
     
    173173    # $session  - a reference to the TWiki session object (if you don't know 
    174174    #             what this is, just ignore it) 
    175     # $params=  - a reference to a TWiki::Attrs object containing parameters. 
     175    # $params=  - a reference to a Foswiki::Attrs object containing parameters. 
    176176    #             This can be used as a simple hash that maps parameter names 
    177177    #             to values, with _DEFAULT being the name for the default 
     
    215215This handler is called very early, immediately after =earlyInitPlugin=. 
    216216 
    217 *Since:* TWiki::Plugins::VERSION = '1.010' 
     217*Since:* Foswiki::Plugins::VERSION = '1.010' 
    218218 
    219219=cut 
     
    223223    ### my ( $loginName, $url, $pathInfo ) = @_; 
    224224 
    225     TWiki::Func::writeDebug( "- ${pluginName}::initializeUserHandler( $_[0], $_[1] )" ) if $debug; 
     225    Foswiki::Func::writeDebug( "- ${pluginName}::initializeUserHandler( $_[0], $_[1] )" ) if $debug; 
    226226} 
    227227 
     
    235235Called when a new user registers with this TWiki. 
    236236 
    237 *Since:* TWiki::Plugins::VERSION = '1.010' 
     237*Since:* Foswiki::Plugins::VERSION = '1.010' 
    238238 
    239239=cut 
     
    243243    ### my ( $web, $wikiName, $loginName ) = @_; 
    244244 
    245     TWiki::Func::writeDebug( "- ${pluginName}::registrationHandler( $_[0], $_[1] )" ) if $debug; 
     245    Foswiki::Func::writeDebug( "- ${pluginName}::registrationHandler( $_[0], $_[1] )" ) if $debug; 
    246246} 
    247247 
     
    259259 
    260260For variables with trivial syntax it is far more efficient to use 
    261 =TWiki::Func::registerTagHandler= (see =initPlugin=). 
     261=Foswiki::Func::registerTagHandler= (see =initPlugin=). 
    262262 
    263263Plugins that have to parse the entire topic content should implement 
    264264this function. Internal TWiki 
    265 variables (and any variables declared using =TWiki::Func::registerTagHandler=) 
     265variables (and any variables declared using =Foswiki::Func::registerTagHandler=) 
    266266are expanded _before_, and then again _after_, this function is called 
    267267to ensure all %<nop>TAGS% are expanded. 
     
    274274handler. Use the =$meta= object. 
    275275 
    276 *Since:* $TWiki::Plugins::VERSION 1.000 
     276*Since:* $Foswiki::Plugins::VERSION 1.000 
    277277 
    278278=cut 
     
    288288    #   } 
    289289 
    290     TWiki::Func::writeDebug( "- ${pluginName}::commonTagsHandler( $_[2].$_[1] )" ) if $debug; 
     290    Foswiki::Func::writeDebug( "- ${pluginName}::commonTagsHandler( $_[2].$_[1] )" ) if $debug; 
    291291 
    292292    # do custom extension rule, like for example: 
     
    322322    ### my ( $text, $topic, $web, $meta ) = @_; 
    323323 
    324     TWiki::Func::writeDebug( "- ${pluginName}::beforeCommonTagsHandler( $_[2].$_[1] )" ) if $debug; 
     324    Foswiki::Func::writeDebug( "- ${pluginName}::beforeCommonTagsHandler( $_[2].$_[1] )" ) if $debug; 
    325325} 
    326326 
     
    349349    ### my ( $text, $topic, $web, $meta ) = @_; 
    350350 
    351     TWiki::Func::writeDebug( "- ${pluginName}::afterCommonTagsHandler( $_[2].$_[1] )" ) if $debug; 
     351    Foswiki::Func::writeDebug( "- ${pluginName}::afterCommonTagsHandler( $_[2].$_[1] )" ) if $debug; 
    352352} 
    353353 
     
    395395handler. 
    396396 
    397 Since TWiki::Plugins::VERSION = '1.026' 
     397Since Foswiki::Plugins::VERSION = '1.026' 
    398398 
    399399=cut 
     
    415415handler. 
    416416 
    417 Since TWiki::Plugins::VERSION = '1.026' 
     417Since Foswiki::Plugins::VERSION = '1.026' 
    418418 
    419419=cut 
     
    436436(using %META: tags) 
    437437 
    438 *Since:* TWiki::Plugins::VERSION = '1.010' 
     438*Since:* Foswiki::Plugins::VERSION = '1.010' 
    439439 
    440440=cut 
     
    444444    ### my ( $text, $topic, $web ) = @_; 
    445445 
    446     TWiki::Func::writeDebug( "- ${pluginName}::beforeEditHandler( $_[2].$_[1] )" ) if $debug; 
     446    Foswiki::Func::writeDebug( "- ${pluginName}::beforeEditHandler( $_[2].$_[1] )" ) if $debug; 
    447447} 
    448448 
     
    462462handler. Use the =$meta= object. 
    463463 
    464 *Since:* $TWiki::Plugins::VERSION 1.010 
     464*Since:* $Foswiki::Plugins::VERSION 1.010 
    465465 
    466466=cut 
     
    470470    ### my ( $text, $topic, $web ) = @_; 
    471471 
    472     TWiki::Func::writeDebug( "- ${pluginName}::afterEditHandler( $_[2].$_[1] )" ) if $debug; 
     472    Foswiki::Func::writeDebug( "- ${pluginName}::afterEditHandler( $_[2].$_[1] )" ) if $debug; 
    473473} 
    474474 
     
    479479   * =$topic= - the name of the topic in the current CGI query 
    480480   * =$web= - the name of the web in the current CGI query 
    481    * =$meta= - the metadata of the topic being saved, represented by a TWiki::Meta object. 
     481   * =$meta= - the metadata of the topic being saved, represented by a Foswiki::Meta object. 
    482482 
    483483This handler is called each time a topic is saved. 
     
    490490text format. 
    491491 
    492 *Since:* TWiki::Plugins::VERSION = '1.010' 
     492*Since:* Foswiki::Plugins::VERSION = '1.010' 
    493493 
    494494=cut 
     
    498498    ### my ( $text, $topic, $web ) = @_; 
    499499 
    500     TWiki::Func::writeDebug( "- ${pluginName}::beforeSaveHandler( $_[2].$_[1] )" ) if $debug; 
     500    Foswiki::Func::writeDebug( "- ${pluginName}::beforeSaveHandler( $_[2].$_[1] )" ) if $debug; 
    501501} 
    502502 
     
    509509   * =$web= - the name of the web in the current CGI query 
    510510   * =$error= - any error string returned by the save. 
    511    * =$meta= - the metadata of the saved topic, represented by a TWiki::Meta object  
     511   * =$meta= - the metadata of the saved topic, represented by a Foswiki::Meta object  
    512512 
    513513This handler is called each time a topic is saved. 
     
    515515__NOTE:__ meta-data is embedded in $text (using %META: tags) 
    516516 
    517 *Since:* TWiki::Plugins::VERSION 1.025 
     517*Since:* Foswiki::Plugins::VERSION 1.025 
    518518 
    519519=cut 
     
    523523    ### my ( $text, $topic, $web, $error, $meta ) = @_; 
    524524 
    525     TWiki::Func::writeDebug( "- ${pluginName}::afterSaveHandler( $_[2].$_[1] )" ) if $debug; 
     525    Foswiki::Func::writeDebug( "- ${pluginName}::afterSaveHandler( $_[2].$_[1] )" ) if $debug; 
    526526} 
    527527 
     
    539539This handler is called just after the rename/move/delete action of a web, topic or attachment. 
    540540 
    541 *Since:* TWiki::Plugins::VERSION = '1.11' 
     541*Since:* Foswiki::Plugins::VERSION = '1.11' 
    542542 
    543543=cut 
     
    547547    ### my ( $oldWeb, $oldTopic, $oldAttachment, $newWeb, $newTopic, $newAttachment ) = @_; 
    548548 
    549     TWiki::Func::writeDebug( "- ${pluginName}::afterRenameHandler( " . 
     549    Foswiki::Func::writeDebug( "- ${pluginName}::afterRenameHandler( " . 
    550550                             "$_[0].$_[1] $_[2] -> $_[3].$_[4] $_[5] )" ) if $debug; 
    551551} 
     
    566566   * =tmpFilename= - name of a temporary file containing the attachment data 
    567567 
    568 *Since:* TWiki::Plugins::VERSION = 1.025 
     568*Since:* Foswiki::Plugins::VERSION = 1.025 
    569569 
    570570=cut 
     
    573573    # do not uncomment, use $_[0], $_[1]... instead 
    574574    ###   my( $attrHashRef, $topic, $web ) = @_; 
    575     TWiki::Func::writeDebug( "- ${pluginName}::beforeAttachmentSaveHandler( $_[2].$_[1] )" ) if $debug; 
     575    Foswiki::Func::writeDebug( "- ${pluginName}::beforeAttachmentSaveHandler( $_[2].$_[1] )" ) if $debug; 
    576576} 
    577577 
     
    589589   * =user= - the user id 
    590590 
    591 *Since:* TWiki::Plugins::VERSION = 1.025 
     591*Since:* Foswiki::Plugins::VERSION = 1.025 
    592592 
    593593=cut 
     
    596596    # do not uncomment, use $_[0], $_[1]... instead 
    597597    ###   my( $attrHashRef, $topic, $web ) = @_; 
    598     TWiki::Func::writeDebug( "- ${pluginName}::afterAttachmentSaveHandler( $_[2].$_[1] )" ) if $debug; 
     598    Foswiki::Func::writeDebug( "- ${pluginName}::afterAttachmentSaveHandler( $_[2].$_[1] )" ) if $debug; 
    599599} 
    600600 
     
    641641required to resolve concurrent edits on a topic. 
    642642 
    643 *Since:* TWiki::Plugins::VERSION = 1.1 
     643*Since:* Foswiki::Plugins::VERSION = 1.1 
    644644 
    645645=cut 
     
    663663Note that this is the HTTP header which is _not_ the same as the HTML 
    664664&lt;HEAD&gt; tag. The contents of the &lt;HEAD&gt; tag may be manipulated 
    665 using the =TWiki::Func::addToHEAD= method. 
    666  
    667 *Since:* TWiki::Plugins::VERSION 1.1 
     665using the =Foswiki::Func::addToHEAD= method. 
     666 
     667*Since:* Foswiki::Plugins::VERSION 1.1 
    668668 
    669669=cut 
     
    672672    my ( $headers, $query ) = @_; 
    673673 
    674     TWiki::Func::writeDebug( "- ${pluginName}::modifyHeaderHandler()" ) if $debug; 
     674    Foswiki::Func::writeDebug( "- ${pluginName}::modifyHeaderHandler()" ) if $debug; 
    675675} 
    676676 
     
    687687the others will be ignored. 
    688688 
    689 *Since:* TWiki::Plugins::VERSION 1.010 
     689*Since:* Foswiki::Plugins::VERSION 1.010 
    690690 
    691691=cut 
     
    695695    ### my ( $query, $url ) = @_; 
    696696 
    697     TWiki::Func::writeDebug( "- ${pluginName}::redirectCgiQueryHandler( query, $_[1] )" ) if $debug; 
     697    Foswiki::Func::writeDebug( "- ${pluginName}::redirectCgiQueryHandler( query, $_[1] )" ) if $debug; 
    698698} 
    699699 
     
    717717continues by considering the built-in types. 
    718718 
    719 *Since:* TWiki::Plugins::VERSION 1.1 
     719*Since:* Foswiki::Plugins::VERSION 1.1 
    720720 
    721721Note that since TWiki-4.2, you can also extend the range of available 
    722 types by providing a subclass of =TWiki::Form::FieldDefinition= to implement 
    723 the new type (see =TWiki::Plugins.JSCalendarContrib= and 
    724 =TWiki::Plugins.RatingContrib= for examples). This is the preferred way to 
     722types by providing a subclass of =Foswiki::Form::FieldDefinition= to implement 
     723the new type (see =Foswiki::Plugins.JSCalendarContrib= and 
     724=Foswiki::Plugins.RatingContrib= for examples). This is the preferred way to 
    725725extend the form field types, but does not work for TWiki < 4.2. 
    726726 
     
    743743Return the new link text. 
    744744 
    745 *Since:* TWiki::Plugins::VERSION 1.1 
     745*Since:* Foswiki::Plugins::VERSION 1.1 
    746746 
    747747=cut 
     
    764764     the page is actually written. This is a string, which must end in \n\n. 
    765765 
    766 *Since:* TWiki::Plugins::VERSION 1.2 
     766*Since:* Foswiki::Plugins::VERSION 1.2 
    767767 
    768768=cut 
     
    784784For more information, check %SYSTEMWEB%.CommandAndCGIScripts#rest 
    785785 
    786 *Since:* TWiki::Plugins::VERSION 1.1 
     786*Since:* Foswiki::Plugins::VERSION 1.1 
    787787 
    788788=cut 
  • trunk/EmptyPlugin/lib/Foswiki/Plugins/EmptyPlugin/MANIFEST

    r14 r811  
    1 data/TWiki/EmptyPlugin.txt 0644 Plugin doc page 
    2 lib/TWiki/Plugins/EmptyPlugin.pm 0444 Plugin Perl module 
     1data/System/EmptyPlugin.txt 0644 Plugin doc page 
     2lib/Foswiki/Plugins/EmptyPlugin.pm 0444 Plugin Perl module 
    33data/Sandbox/PluginTestEmptyPlugin.txt 0644 Plugin examples 
  • trunk/EmptyPlugin/lib/Foswiki/Plugins/EmptyPlugin/build.pl

    r736 r811  
    44# plugin or contrib and edit. 
    55# 
    6 # Read the comments at the top of lib/TWiki/Contrib/Build.pm for 
     6# Read the comments at the top of lib/Foswiki/Contrib/Build.pm for 
    77# details of how the build process works, and what files you 
    88# have to provide and where. 
     
    2323} 
    2424 
    25 use TWiki::Contrib::Build; 
     25use Foswiki::Contrib::Build; 
    2626 
    2727# Declare our build package 
    2828package BuildBuild; 
    29 use base qw( TWiki::Contrib::Build ); 
     29use base qw( Foswiki::Contrib::Build ); 
    3030 
    3131sub new { 
  • trunk/EmptyPlugin/test/unit/EmptyPlugin/EmptyPluginTests.pm

    r14 r811  
    66 
    77use strict; 
    8 use TWiki; 
     8use Foswiki; 
    99use CGI; 
    1010 
     
    2222    $this->SUPER::set_up(); 
    2323 
    24     $TWiki::Plugins::SESSION = $twiki; 
     24    $Foswiki::Plugins::SESSION = $twiki; 
    2525} 
    2626 
  • trunk/InterwikiPlugin/lib/Foswiki/Plugins/InterwikiPlugin.pm

    r781 r811  
    1818=pod 
    1919 
    20 ---+ package TWiki::Plugins::InterwikiPlugin 
     20---+ package Foswiki::Plugins::InterwikiPlugin 
    2121 
    2222Recognises and processes special links to other sites defined 
     
    3434=cut 
    3535 
    36 package TWiki::Plugins::InterwikiPlugin; 
     36package Foswiki::Plugins::InterwikiPlugin; 
    3737 
    3838use strict; 
    3939 
    40 require TWiki::Func;    # The plugins API 
    41 require TWiki::Plugins; # For the API version 
     40require Foswiki::Func;    # The plugins API 
     41require Foswiki::Plugins; # For the API version 
    4242 
    4343use vars qw( 
     
    6363BEGIN { 
    6464    # 'Use locale' for internationalisation of Perl sorting and searching -  
    65     if( $TWiki::cfg{UseLocale} ) { 
     65    if( $Foswiki::cfg{UseLocale} ) { 
    6666        require locale; 
    6767        import locale (); 
     
    7676 
    7777    # check for Plugins.pm versions 
    78     if( $TWiki::Plugins::VERSION < 1.026 ) { 
    79         TWiki::Func::writeWarning( "Version mismatch between InterwikiPlugin and Plugins.pm" ); 
     78    if( $Foswiki::Plugins::VERSION < 1.026 ) { 
     79        Foswiki::Func::writeWarning( "Version mismatch between InterwikiPlugin and Plugins.pm" ); 
    8080        return 0; 
    8181    } 
    8282 
    8383    # Regexes for the Site:page format InterWiki reference 
    84     my $man = TWiki::Func::getRegularExpression('mixedAlphaNum'); 
    85     my $ua = TWiki::Func::getRegularExpression('upperAlpha'); 
     84    my $man = Foswiki::Func::getRegularExpression('mixedAlphaNum'); 
     85    my $ua = Foswiki::Func::getRegularExpression('upperAlpha'); 
    8686    $sitePattern    = "([$ua][$man]+)"; 
    8787    $pagePattern    = "([${man}_\/][$man" . '\.\/\+\_\,\;\:\!\?\%\#\@\-]*?)'; 
     
    8989    # Get plugin preferences from InterwikiPlugin topic 
    9090    $interLinkFormat = 
    91       TWiki::Func::getPreferencesValue( 'INTERWIKIPLUGIN_INTERLINKFORMAT' ) || 
     91      Foswiki::Func::getPreferencesValue( 'INTERWIKIPLUGIN_INTERLINKFORMAT' ) || 
    9292      '<a href="$url" title="$tooltip"><noautolink>$label</noautolink></a>'; 
    9393 
    9494    my $interTopic = 
    95       TWiki::Func::getPreferencesValue( 'INTERWIKIPLUGIN_RULESTOPIC' ) 
     95      Foswiki::Func::getPreferencesValue( 'INTERWIKIPLUGIN_RULESTOPIC' ) 
    9696          || 'InterWikis'; 
    9797    ( $interWeb, $interTopic ) = 
    98       TWiki::Func::normalizeWebTopicName( $interWeb, $interTopic ); 
     98      Foswiki::Func::normalizeWebTopicName( $interWeb, $interTopic ); 
    9999    if( $interTopic =~ s/^(.*)\.// ) { 
    100100        $interWeb = $1; 
    101101    } 
    102102 
    103     my $text = TWiki::Func::readTopicText( $interWeb, $interTopic, undef, 1 ); 
     103    my $text = Foswiki::Func::readTopicText( $interWeb, $interTopic, undef, 1 ); 
    104104 
    105105    # '| alias | URL | ...' table and extract into 'alias', "URL" list 
  • trunk/InterwikiPlugin/lib/Foswiki/Plugins/InterwikiPlugin/MANIFEST

    r14 r811  
    1 lib/TWiki/Plugins/InterwikiPlugin.pm 0444 
    2 data/TWiki/InterwikiPlugin.txt 0644 
    3 data/TWiki/InterWikis.txt 0644 
     1lib/Foswiki/Plugins/InterwikiPlugin.pm 0444 
     2data/System/InterwikiPlugin.txt 0644 
     3data/System/InterWikis.txt 0644 
  • trunk/InterwikiPlugin/lib/Foswiki/Plugins/InterwikiPlugin/build.pl

    r14 r811  
    99} 
    1010 
    11 use TWiki::Contrib::Build; 
     11use Foswiki::Contrib::Build; 
    1212 
    1313# Create the build object 
    14 $build = new TWiki::Contrib::Build( 'InterwikiPlugin' ); 
     14$build = new Foswiki::Contrib::Build( 'InterwikiPlugin' ); 
    1515 
    1616# Build the target on the command line, or the default target 
  • trunk/JSCalendarContrib/lib/Foswiki/Contrib/JSCalendarContrib.pm

    r739 r811  
    1010=cut 
    1111 
    12 package TWiki::Contrib::JSCalendarContrib; 
     12package Foswiki::Contrib::JSCalendarContrib; 
    1313 
    1414use strict; 
    1515 
    16 require TWiki::Func;    # The plugins API 
     16require Foswiki::Func;    # The plugins API 
    1717 
    1818use vars qw( $VERSION $RELEASE $SHORTDESCRIPTION ); 
     
    5555=begin twiki 
    5656 
    57 ---+++ TWiki::Contrib::JSCalendarContrib::renderDateForEdit($name, $value, $format [, \%cssClass]) -> $html 
     57---+++ Foswiki::Contrib::JSCalendarContrib::renderDateForEdit($name, $value, $format [, \%cssClass]) -> $html 
    5858 
    5959This is the simplest way to use calendars from a plugin. 
     
    6868Example: 
    6969<verbatim> 
    70 use TWiki::Contrib::JSCalendarContrib; 
     70use Foswiki::Contrib::JSCalendarContrib; 
    7171... 
    72 my $fromDate = TWiki::Contrib::JSCalendarContrib::renderDateForEdit( 
     72my $fromDate = Foswiki::Contrib::JSCalendarContrib::renderDateForEdit( 
    7373   'from', '1 April 1999'); 
    74 my $toDate = TWiki::Contrib::JSCalendarContrib::renderDateForEdit( 
     74my $toDate = Foswiki::Contrib::JSCalendarContrib::renderDateForEdit( 
    7575   'to', undef, '%Y'); 
    7676</verbatim> 
     
    8181    my ($name, $value, $format, $options) = @_; 
    8282 
    83     $format ||= $TWiki::cfg{JSCalendarContrib}{format} || '%e %B %Y'; 
     83    $format ||= $Foswiki::cfg{JSCalendarContrib}{format} || '%e %B %Y'; 
    8484 
    8585    addHEAD('twiki'); 
     
    101101          -onclick => 
    102102            "javascript: return showCalendar('id_$name','$format')", 
    103             -src=> TWiki::Func::getPubUrlPath() . '/' . 
    104               TWiki::Func::getTwikiWebname() . 
     103            -src=> Foswiki::Func::getPubUrlPath() . '/' . 
     104              Foswiki::Func::getTwikiWebname() . 
    105105                  '/JSCalendarContrib/img.gif', 
    106106          -alt => 'Calendar', 
     
    110110=begin twiki 
    111111 
    112 ---+++ TWiki::Contrib::JSCalendarContrib::addHEAD($setup) 
     112---+++ Foswiki::Contrib::JSCalendarContrib::addHEAD($setup) 
    113113 
    114114This function will automatically add the headers for the calendar to the page 
     
    124124<verbatim> 
    125125# Add styles and javascript for the calendar 
    126 use TWiki::Contrib::JSCalendarContrib; 
     126use Foswiki::Contrib::JSCalendarContrib; 
    127127... 
    128128 
     
    130130  .... 
    131131  # Enable 'showCalendar' 
    132   TWiki::Contrib::JSCalendarContrib::addHEAD( 'twiki' ); 
     132  Foswiki::Contrib::JSCalendarContrib::addHEAD( 'twiki' ); 
    133133 
    134134  my $cal = CGI::image_button( 
     
    136136      -onclick => 
    137137       "return showCalendar('id_datefield','%Y %b %e')", 
    138       -src=> TWiki::Func::getPubUrlPath() . '/' . 
    139              TWiki::Func::getTwikiWebname() . 
     138      -src=> Foswiki::Func::getPubUrlPath() . '/' . 
     139             Foswiki::Func::getTwikiWebname() . 
    140140             '/JSCalendarContrib/img.gif', 
    141141      -alt => 'Calendar', 
     
    188188    my $setup = shift; 
    189189    $setup ||= 'calendar-setup'; 
    190     my $style = $TWiki::cfg{JSCalendarContrib}{style} || 'blue'; 
    191     my $lang = $TWiki::cfg{JSCalendarContrib}{lang} || 'en'; 
     190    my $style = $Foswiki::cfg{JSCalendarContrib}{style} || 'blue'; 
     191    my $lang = $Foswiki::cfg{JSCalendarContrib}{lang} || 'en'; 
    192192    my $base = '%PUBURLPATH%/%SYSTEMWEB%/JSCalendarContrib'; 
    193193    eval { 
    194         require TWiki::Contrib::BehaviourContrib; 
    195         if (defined(&TWiki::Contrib::BehaviourContrib::addHEAD)) { 
    196             TWiki::Contrib::BehaviourContrib::addHEAD(); 
     194        require Foswiki::Contrib::BehaviourContrib; 
     195        if (defined(&Foswiki::Contrib::BehaviourContrib::addHEAD)) { 
     196            Foswiki::Contrib::BehaviourContrib::addHEAD(); 
    197197        } else { 
    198             TWiki::Func::addToHEAD( 
     198            Foswiki::Func::addToHEAD( 
    199199                'BEHAVIOURCONTRIB', 
    200200                '<script type="text/javascript" src="%PUBURLPATH%/%SYSTEMWEB%/BehaviourContrib/behaviour.compressed.js"></script>'); 
     
    209209<script type='text/javascript' src='$base/lang/calendar-$lang.js'></script> 
    210210HERE 
    211     TWiki::Func::addToHEAD( 'JSCALENDARCONTRIB', $head ); 
     211    Foswiki::Func::addToHEAD( 'JSCALENDARCONTRIB', $head ); 
    212212 
    213213    # Add the setup separately; there might be different setups required 
     
    216216<script type='text/javascript' src='$base/$setup.js'></script> 
    217217HERE 
    218     TWiki::Func::addToHEAD( 'JSCALENDARCONTRIB_'.$setup, $head ); 
     218    Foswiki::Func::addToHEAD( 'JSCALENDARCONTRIB_'.$setup, $head ); 
    219219} 
    220220 
  • trunk/JSCalendarContrib/lib/Foswiki/Contrib/JSCalendarContrib/MANIFEST

    r14 r811  
    1 data/TWiki/JSCalendarContrib.txt 0644 
    2 data/TWiki/JSCalendarContribInline.txt 0644 
    3 lib/TWiki/Contrib/JSCalendarContrib.pm 0444 
    4 lib/TWiki/Form/Date.pm 0444 Perl module that implements the =date= type 
    5 pub/TWiki/JSCalendarContrib/twiki.js 0644 
    6 pub/TWiki/JSCalendarContrib/wikiringlogo20x20.png 0644 
    7 pub/TWiki/JSCalendarContrib/bugtest-hidden-selects.html 0644 
    8 pub/TWiki/JSCalendarContrib/calendar-blue2.css 0644 
    9 pub/TWiki/JSCalendarContrib/calendar-blue.css 0644 
    10 pub/TWiki/JSCalendarContrib/calendar-brown.css 0644 
    11 pub/TWiki/JSCalendarContrib/calendar-green.css 0644 
    12 pub/TWiki/JSCalendarContrib/calendar.js 0644 
    13 pub/TWiki/JSCalendarContrib/calendar.php 0644 
    14 pub/TWiki/JSCalendarContrib/calendar-setup.js 0644 
    15 pub/TWiki/JSCalendarContrib/calendar-setup_stripped.js 0644 
    16 pub/TWiki/JSCalendarContrib/calendar_stripped.js 0644 
    17 pub/TWiki/JSCalendarContrib/calendar-system.css 0644 
    18 pub/TWiki/JSCalendarContrib/calendar-tas.css 0644 
    19 pub/TWiki/JSCalendarContrib/calendar-win2k-1.css 0644 
    20 pub/TWiki/JSCalendarContrib/calendar-win2k-2.css 0644 
    21 pub/TWiki/JSCalendarContrib/calendar-win2k-cold-1.css 0644 
    22 pub/TWiki/JSCalendarContrib/calendar-win2k-cold-2.css 0644 
    23 pub/TWiki/JSCalendarContrib/ChangeLog 0644 
    24 pub/TWiki/JSCalendarContrib/dayinfo.html 0644 
    25 pub/TWiki/JSCalendarContrib/doc/html/field-button.jpg 0644 
    26 pub/TWiki/JSCalendarContrib/doc/html/reference.css 0644 
    27 pub/TWiki/JSCalendarContrib/doc/html/reference.html 0644 
    28 pub/TWiki/JSCalendarContrib/doc/html/reference-Z-S.css 0644 
    29 pub/TWiki/JSCalendarContrib/doc/reference.pdf 0644 
    30 pub/TWiki/JSCalendarContrib/img.gif 0644 
    31 pub/TWiki/JSCalendarContrib/index.html 0644 
    32 pub/TWiki/JSCalendarContrib/lang/calendar-af.js 0644 
    33 pub/TWiki/JSCalendarContrib/lang/calendar-al.js 0644 
    34 pub/TWiki/JSCalendarContrib/lang/calendar-bg.js 0644 
    35 pub/TWiki/JSCalendarContrib/lang/calendar-big5.js 0644 
    36 pub/TWiki/JSCalendarContrib/lang/calendar-big5-utf8.js 0644 
    37 pub/TWiki/JSCalendarContrib/lang/calendar-br.js 0644 
    38 pub/TWiki/JSCalendarContrib/lang/calendar-ca.js 0644 
    39 pub/TWiki/JSCalendarContrib/lang/calendar-cs-utf8.js 0644 
    40 pub/TWiki/JSCalendarContrib/lang/calendar-cs-win.js 0644 
    41 pub/TWiki/JSCalendarContrib/lang/calendar-da.js 0644 
    42 pub/TWiki/JSCalendarContrib/lang/calendar-de.js 0644 
    43 pub/TWiki/JSCalendarContrib/lang/calendar-du.js 0644 
    44 pub/TWiki/JSCalendarContrib/lang/calendar-el.js 0644 
    45 pub/TWiki/JSCalendarContrib/lang/calendar-en.js 0644 
    46 pub/TWiki/JSCalendarContrib/lang/calendar-es.js 0644 
    47 pub/TWiki/JSCalendarContrib/lang/calendar-fi.js 0644 
    48 pub/TWiki/JSCalendarContrib/lang/calendar-fr.js 0644 
    49 pub/TWiki/JSCalendarContrib/lang/calendar-he-utf8.js 0644 
    50 pub/TWiki/JSCalendarContrib/lang/calendar-hr.js 0644 
    51 pub/TWiki/JSCalendarContrib/lang/calendar-hr-utf8.js 0644 
    52 pub/TWiki/JSCalendarContrib/lang/calendar-hu.js 0644 
    53 pub/TWiki/JSCalendarContrib/lang/calendar-it.js 0644 
    54 pub/TWiki/JSCalendarContrib/lang/calendar-jp.js 0644 
    55 pub/TWiki/JSCalendarContrib/lang/calendar-ko.js 0644 
    56 pub/TWiki/JSCalendarContrib/lang/calendar-ko-utf8.js 0644 
    57 pub/TWiki/JSCalendarContrib/lang/calendar-lt.js 0644 
    58 pub/TWiki/JSCalendarContrib/lang/calendar-lt-utf8.js 0644 
    59 pub/TWiki/JSCalendarContrib/lang/calendar-lv.js 0644 
    60 pub/TWiki/JSCalendarContrib/lang/calendar-nl.js 0644 
    61 pub/TWiki/JSCalendarContrib/lang/calendar-no.js 0644 
    62 pub/TWiki/JSCalendarContrib/lang/calendar-pl.js 0644 
    63 pub/TWiki/JSCalendarContrib/lang/calendar-pl-utf8.js 0644 
    64 pub/TWiki/JSCalendarContrib/lang/calendar-pt.js 0644 
    65 pub/TWiki/JSCalendarContrib/lang/calendar-ro.js 0644 
    66 pub/TWiki/JSCalendarContrib/lang/calendar-ru_win_.js 0644 
    67 pub/TWiki/JSCalendarContrib/lang/calendar-ru.js 0644 
    68 pub/TWiki/JSCalendarContrib/lang/calendar-si.js 0644 
    69 pub/TWiki/JSCalendarContrib/lang/calendar-sk.js 0644 
    70 pub/TWiki/JSCalendarContrib/lang/calendar-sp.js 0644 
    71 pub/TWiki/JSCalendarContrib/lang/calendar-sv.js 0644 
    72 pub/TWiki/JSCalendarContrib/lang/calendar-tr.js 0644 
    73 pub/TWiki/JSCalendarContrib/lang/calendar-zh.js 0644 
    74 pub/TWiki/JSCalendarContrib/lang/cn_utf8.js 0644 
    75 pub/TWiki/JSCalendarContrib/skins/aqua/active-bg.gif 0644 
    76 pub/TWiki/JSCalendarContrib/skins/aqua/dark-bg.gif 0644 
    77 pub/TWiki/JSCalendarContrib/skins/aqua/hover-bg.gif 0644 
    78 pub/TWiki/JSCalendarContrib/skins/aqua/menuarrow.gif 0644 
    79 pub/TWiki/JSCalendarContrib/skins/aqua/normal-bg.gif 0644 
    80 pub/TWiki/JSCalendarContrib/skins/aqua/rowhover-bg.gif 0644 
    81 pub/TWiki/JSCalendarContrib/skins/aqua/status-bg.gif 0644 
    82 pub/TWiki/JSCalendarContrib/skins/aqua/theme.css 0644 
    83 pub/TWiki/JSCalendarContrib/skins/aqua/title-bg.gif 0644 
    84 pub/TWiki/JSCalendarContrib/skins/aqua/today-bg.gif 0644 
    85 pub/TWiki/JSCalendarContrib/skins/aqua/transparent-bg.png 0644 
    86 pub/TWiki/JSCalendarContrib/menuarrow.gif 0644 
    87 pub/TWiki/JSCalendarContrib/menuarrow2.gif 0644 
    88 pub/TWiki/JSCalendarContrib/multiple-dates.html 0644 
    89 pub/TWiki/JSCalendarContrib/README 0644 
    90 pub/TWiki/JSCalendarContrib/release-notes.html 0644 
    91 pub/TWiki/JSCalendarContrib/simple-1.html 0644 
    92 pub/TWiki/JSCalendarContrib/simple-2.html 0644 
    93 pub/TWiki/JSCalendarContrib/simple-3.html 0644 
    94 pub/TWiki/JSCalendarContrib/test.php 0644 
    95 pub/TWiki/JSCalendarContrib/test-position.html 0644 
     1data/System/JSCalendarContrib.txt 0644 
     2data/System/JSCalendarContribInline.txt 0644 
     3lib/Foswiki/Contrib/JSCalendarContrib.pm 0444 
     4lib/Foswiki/Form/Date.pm 0444 Perl module that implements the =date= type 
     5pub/System/JSCalendarContrib/twiki.js 0644 
     6pub/System/JSCalendarContrib/wikiringlogo20x20.png 0644 
     7pub/System/JSCalendarContrib/bugtest-hidden-selects.html 0644 
     8pub/System/JSCalendarContrib/calendar-blue2.css 0644 
     9pub/System/JSCalendarContrib/calendar-blue.css 0644 
     10pub/System/JSCalendarContrib/calendar-brown.css 0644 
     11pub/System/JSCalendarContrib/calendar-green.css 0644 
     12pub/System/JSCalendarContrib/calendar.js 0644 
     13pub/System/JSCalendarContrib/calendar.php 0644 
     14pub/System/JSCalendarContrib/calendar-setup.js 0644 
     15pub/System/JSCalendarContrib/calendar-setup_stripped.js 0644 
     16pub/System/JSCalendarContrib/calendar_stripped.js 0644 
     17pub/System/JSCalendarContrib/calendar-system.css 0644 
     18pub/System/JSCalendarContrib/calendar-tas.css 0644 
     19pub/System/JSCalendarContrib/calendar-win2k-1.css 0644 
     20pub/System/JSCalendarContrib/calendar-win2k-2.css 0644 
     21pub/System/JSCalendarContrib/calendar-win2k-cold-1.css 0644 
     22pub/System/JSCalendarContrib/calendar-win2k-cold-2.css 0644 
     23pub/System/JSCalendarContrib/ChangeLog 0644 
     24pub/System/JSCalendarContrib/dayinfo.html 0644 
     25pub/System/JSCalendarContrib/doc/html/field-button.jpg 0644 
     26pub/System/JSCalendarContrib/doc/html/reference.css 0644 
     27pub/System/JSCalendarContrib/doc/html/reference.html 0644 
     28pub/System/JSCalendarContrib/doc/html/reference-Z-S.css 0644 
     29pub/System/JSCalendarContrib/doc/reference.pdf 0644 
     30pub/System/JSCalendarContrib/img.gif 0644 
     31pub/System/JSCalendarContrib/index.html 0644 
     32pub/System/JSCalendarContrib/lang/calendar-af.js 0644 
     33pub/System/JSCalendarContrib/lang/calendar-al.js 0644 
     34pub/System/JSCalendarContrib/lang/calendar-bg.js 0644 
     35pub/System/JSCalendarContrib/lang/calendar-big5.js 0644 
     36pub/System/JSCalendarContrib/lang/calendar-big5-utf8.js 0644 
     37pub/System/JSCalendarContrib/lang/calendar-br.js 0644 
     38pub/System/JSCalendarContrib/lang/calendar-ca.js 0644 
     39pub/System/JSCalendarContrib/lang/calendar-cs-utf8.js 0644 
     40pub/System/JSCalendarContrib/lang/calendar-cs-win.js 0644 
     41pub/System/JSCalendarContrib/lang/calendar-da.js 0644 
     42pub/System/JSCalendarContrib/lang/calendar-de.js 0644 
     43pub/System/JSCalendarContrib/lang/calendar-du.js 0644 
     44pub/System/JSCalendarContrib/lang/calendar-el.js 0644 
     45pub/System/JSCalendarContrib/lang/calendar-en.js 0644 
     46pub/System/JSCalendarContrib/lang/calendar-es.js 0644 
     47pub/System/JSCalendarContrib/lang/calendar-fi.js 0644 
     48pub/System/JSCalendarContrib/lang/calendar-fr.js 0644 
     49pub/System/JSCalendarContrib/lang/calendar-he-utf8.js 0644 
     50pub/System/JSCalendarContrib/lang/calendar-hr.js 0644 
     51pub/System/JSCalendarContrib/lang/calendar-hr-utf8.js 0644 
     52pub/System/JSCalendarContrib/lang/calendar-hu.js 0644 
     53pub/System/JSCalendarContrib/lang/calendar-it.js 0644 
     54pub/System/JSCalendarContrib/lang/calendar-jp.js 0644 
     55pub/System/JSCalendarContrib/lang/calendar-ko.js 0644 
     56pub/System/JSCalendarContrib/lang/calendar-ko-utf8.js 0644 
     57pub/System/JSCalendarContrib/lang/calendar-lt.js 0644 
     58pub/System/JSCalendarContrib/lang/calendar-lt-utf8.js 0644 
     59pub/System/JSCalendarContrib/lang/calendar-lv.js 0644 
     60pub/System/JSCalendarContrib/lang/calendar-nl.js 0644 
     61pub/System/JSCalendarContrib/lang/calendar-no.js 0644 
     62pub/System/JSCalendarContrib/lang/calendar-pl.js 0644 
     63pub/System/JSCalendarContrib/lang/calendar-pl-utf8.js 0644 
     64pub/System/JSCalendarContrib/lang/calendar-pt.js 0644 
     65pub/System/JSCalendarContrib/lang/calendar-ro.js 0644 
     66pub/System/JSCalendarContrib/lang/calendar-ru_win_.js 0644 
     67pub/System/JSCalendarContrib/lang/calendar-ru.js 0644 
     68pub/System/JSCalendarContrib/lang/calendar-si.js 0644 
     69pub/System/JSCalendarContrib/lang/calendar-sk.js 0644 
     70pub/System/JSCalendarContrib/lang/calendar-sp.js 0644 
     71pub/System/JSCalendarContrib/lang/calendar-sv.js 0644 
     72pub/System/JSCalendarContrib/lang/calendar-tr.js 0644 
     73pub/System/JSCalendarContrib/lang/calendar-zh.js 0644 
     74pub/System/JSCalendarContrib/lang/cn_utf8.js 0644 
     75pub/System/JSCalendarContrib/skins/aqua/active-bg.gif 0644 
     76pub/System/JSCalendarContrib/skins/aqua/dark-bg.gif 0644 
     77pub/System/JSCalendarContrib/skins/aqua/hover-bg.gif 0644 
     78pub/System/JSCalendarContrib/skins/aqua/menuarrow.gif 0644 
     79pub/System/JSCalendarContrib/skins/aqua/normal-bg.gif 0644 
     80pub/System/JSCalendarContrib/skins/aqua/rowhover-bg.gif 0644 
     81pub/System/JSCalendarContrib/skins/aqua/status-bg.gif 0644 
     82pub/System/JSCalendarContrib/skins/aqua/theme.css 0644 
     83pub/System/JSCalendarContrib/skins/aqua/title-bg.gif 0644 
     84pub/System/JSCalendarContrib/skins/aqua/today-bg.gif 0644 
     85pub/System/JSCalendarContrib/skins/aqua/transparent-bg.png 0644 
     86pub/System/JSCalendarContrib/menuarrow.gif 0644 
     87pub/System/JSCalendarContrib/menuarrow2.gif 0644 
     88pub/System/JSCalendarContrib/multiple-dates.html 0644 
     89pub/System/JSCalendarContrib/README 0644 
     90pub/System/JSCalendarContrib/release-notes.html 0644 
     91pub/System/JSCalendarContrib/simple-1.html 0644 
     92pub/System/JSCalendarContrib/simple-2.html 0644 
     93pub/System/JSCalendarContrib/simple-3.html 0644 
     94pub/System/JSCalendarContrib/test.php 0644 
     95pub/System/JSCalendarContrib/test-position.html 0644 
    9696 
  • trunk/JSCalendarContrib/lib/Foswiki/Contrib/JSCalendarContrib/build.pl

    r736 r811  
    44# plugin or contrib and edit. 
    55# 
    6 # Read the comments at the top of lib/TWiki/Contrib/Build.pm for 
     6# Read the comments at the top of lib/Foswiki/Contrib/Build.pm for 
    77# details of how the build process works, and what files you 
    88# have to provide and where. 
     
    2525} 
    2626 
    27 use TWiki::Contrib::Build; 
     27use Foswiki::Contrib::Build; 
    2828 
    2929package JSCalendarBuild; 
    3030 
    31 @JSCalendarBuild::ISA = ( "TWiki::Contrib::Build" ); 
     31@JSCalendarBuild::ISA = ( "Foswiki::Contrib::Build" ); 
    3232 
    3333sub new { 
  • trunk/JSCalendarContrib/lib/Foswiki/Form/Date.pm

    r782 r811  
    11# See bottom of file for license and copyright details 
    2 # This packages subclasses TWiki::Form::FieldDefinition to implement 
     2# This packages subclasses Foswiki::Form::FieldDefinition to implement 
    33# the =date= type 
    44 
    5 package TWiki::Form::Date; 
    6 use base 'TWiki::Form::FieldDefinition'; 
     5package Foswiki::Form::Date; 
     6use base 'Foswiki::Form::FieldDefinition'; 
    77 
    88use strict; 
    99 
    10 use TWiki::Contrib::JSCalendarContrib; 
     10use Foswiki::Contrib::JSCalendarContrib; 
    1111 
    1212sub new { 
     
    3131            $this->cssClasses('twikiInputField', 'twikiEditFormDateField') : 
    3232              'twikiInputField twikiEditFormDateField'}); 
    33     my $ifFormat = $TWiki::cfg{JSCalendarContrib}{format} || '%e %b %Y'; 
    34     TWiki::Contrib::JSCalendarContrib::addHEAD( 'twiki' ); 
     33    my $ifFormat = $Foswiki::cfg{JSCalendarContrib}{format} || '%e %b %Y'; 
     34    Foswiki::Contrib::JSCalendarContrib::addHEAD( 'twiki' ); 
    3535    my $button .= CGI::image_button( 
    3636        -name => 'calendar', 
    3737        -onclick => 
    3838          "return showCalendar('id$this->{name}','$ifFormat')", 
    39         -src=> $TWiki::cfg{PubUrlPath} . '/' . 
    40           $TWiki::cfg{SystemWebName} . 
     39        -src=> $Foswiki::cfg{PubUrlPath} . '/' . 
     40          $Foswiki::cfg{SystemWebName} . 
    4141            '/JSCalendarContrib/img.gif', 
    4242        -alt => 'Calendar', 
     
    5656__DATA__ 
    5757 
    58 Module of Foswiki - The Free Open Source Wiki, http://foswiki.org/, http://TWiki.org/ 
     58Module of Foswiki - The Free Open Source Wiki, http://foswiki.org/, http://Foswiki.org/ 
    5959 
    60 Copyright (C) 2001-2007 TWiki Contributors. All Rights Reserved. 
    61 TWiki Contributors are listed in the AUTHORS file in the root of 
     60Copyright (C) 2001-2007 Foswiki Contributors. All Rights Reserved. 
     61Foswiki Contributors are listed in the AUTHORS file in the root of 
    6262this distribution. NOTE: Please extend that file, not this notice. 
    6363 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib.pm

    r781 r811  
    22# 
    33# Copyright (C) 2004 Wind River Systems Inc. 
    4 # Copyright (C) 1999-2006 TWiki Contributors. 
    5 # All Rights Reserved. TWiki Contributors 
     4# Copyright (C) 1999-2006 Foswiki Contributors. 
     5# All Rights Reserved. Foswiki Contributors 
    66# are listed in the AUTHORS file in the root of this distribution. 
    77# NOTE: Please extend that file, not this notice. 
     
    2121=pod 
    2222 
    23 ---+ package TWiki::Contrib::MailerContrib 
     23---+ package Foswiki::Contrib::MailerContrib 
    2424 
    2525Package of support for extended Web<nop>Notify notification, supporting per-topic notification and notification of changes to children. 
     
    2929=cut 
    3030 
    31 package TWiki::Contrib::MailerContrib; 
     31package Foswiki::Contrib::MailerContrib; 
    3232 
    3333use strict; 
     
    3636use CGI qw(-any); 
    3737 
    38 require TWiki; 
    39 require TWiki::Plugins; 
    40 require TWiki::Time; 
    41 require TWiki::Func; 
    42 require TWiki::Contrib::MailerContrib::WebNotify; 
    43 require TWiki::Contrib::MailerContrib::Change; 
    44 require TWiki::Contrib::MailerContrib::UpData; 
     38require Foswiki; 
     39require Foswiki::Plugins; 
     40require Foswiki::Time; 
     41require Foswiki::Func; 
     42require Foswiki::Contrib::MailerContrib::WebNotify; 
     43require Foswiki::Contrib::MailerContrib::Change; 
     44require Foswiki::Contrib::MailerContrib::UpData; 
    4545 
    4646use vars qw ( $VERSION $RELEASE $verbose ); 
     
    5151# PROTECTED STATIC ensure the contrib is initernally initialised 
    5252sub initContrib { 
    53     $TWiki::cfg{MailerContrib}{EmailFilterIn} ||= 
    54       $TWiki::regex{emailAddrRegex}; 
     53    $Foswiki::cfg{MailerContrib}{EmailFilterIn} ||= 
     54      $Foswiki::regex{emailAddrRegex}; 
    5555} 
    5656 
     
    9090 
    9191    if (!defined $twiki) { 
    92         $twiki = new TWiki(); 
    93     } 
    94  
    95     $TWiki::Plugins::SESSION = $twiki; 
    96  
    97     my $context = TWiki::Func::getContext(); 
     92        $twiki = new Foswiki(); 
     93    } 
     94 
     95    $Foswiki::Plugins::SESSION = $twiki; 
     96 
     97    my $context = Foswiki::Func::getContext(); 
    9898 
    9999    $context->{command_line} = 1; 
     
    105105 
    106106    my $report = ''; 
    107     foreach my $web ( TWiki::Func::getListOfWebs( 'user ') ) { 
     107    foreach my $web ( Foswiki::Func::getListOfWebs( 'user ') ) { 
    108108       if ( $web =~ /^($webstr)$/ && $web !~ /^($exwebstr)$/ ) { 
    109109          $report .= _processWeb( $twiki, $web ); 
     
    124124 
    125125    #we can get away with a normalise on a list of topics, so long as the list starts with a topic 
    126     my ($web, $t) = TWiki::Func::normalizeWebTopicName($defaultWeb, $topicList); 
     126    my ($web, $t) = Foswiki::Func::normalizeWebTopicName($defaultWeb, $topicList); 
    127127    #TODO: this limits us to subscribing to one web. 
    128     my $wn = new TWiki::Contrib::MailerContrib::WebNotify( 
    129         $TWiki::Plugins::SESSION, $web, $TWiki::cfg{NotifyTopicName}, 1 ); 
     128    my $wn = new Foswiki::Contrib::MailerContrib::WebNotify( 
     129        $Foswiki::Plugins::SESSION, $web, $Foswiki::cfg{NotifyTopicName}, 1 ); 
    130130    $wn->parsePageSubscriptions( $who, $topicList, $unsubscribe ); 
    131131    $wn->writeWebNotify(); 
     
    151151                    }; 
    152152 
    153     my $ret = TWiki::Contrib::MailerContrib::parsePageList($subscribed, $who, $topicList); 
     153    my $ret = Foswiki::Contrib::MailerContrib::parsePageList($subscribed, $who, $topicList); 
    154154     
    155155    return (!defined($subscribed->{not_subscribed}) || 
     
    159159    my ( $subscribed, $who, $unsubscribe, $topic, $options, $childDepth ) = @_; 
    160160     
    161     require TWiki::Contrib::MailerContrib::WebNotify; 
    162     my ($sweb, $stopic) = TWiki::Func::normalizeWebTopicName($subscribed->{currentWeb}, $topic); 
     161    require Foswiki::Contrib::MailerContrib::WebNotify; 
     162    my ($sweb, $stopic) = Foswiki::Func::normalizeWebTopicName($subscribed->{currentWeb}, $topic); 
    163163 
    164164    #TODO: extract this code so we only create $wn objects for each web once..     
    165     my $wn = new TWiki::Contrib::MailerContrib::WebNotify( $TWiki::Plugins::SESSION, $sweb, $TWiki::cfg{NotifyTopicName} ); 
     165    my $wn = new Foswiki::Contrib::MailerContrib::WebNotify( $Foswiki::Plugins::SESSION, $sweb, $Foswiki::cfg{NotifyTopicName} ); 
    166166    my $subscriber = $wn->getSubscriber($who); 
    167167     
    168     my $db = new TWiki::Contrib::MailerContrib::UpData( $TWiki::Plugins::SESSION, $sweb ); 
     168    my $db = new Foswiki::Contrib::MailerContrib::UpData( $Foswiki::Plugins::SESSION, $sweb ); 
    169169    #TODO: need to check $childDepth topics too (somehow) 
    170170    if ( $subscriber->isSubscribedTo($stopic, $db) && 
     
    207207    my( $twiki, $web) = @_; 
    208208 
    209     if( ! TWiki::Func::webExists( $web ) ) { 
     209    if( ! Foswiki::Func::webExists( $web ) ) { 
    210210#        print STDERR "**** ERROR mailnotifier cannot find web $web\n"; 
    211211        return ''; 
     
    217217 
    218218    # Read the webnotify and load subscriptions 
    219     my $wn = new TWiki::Contrib::MailerContrib::WebNotify( 
    220         $twiki, $web, $TWiki::cfg{NotifyTopicName} ); 
     219    my $wn = new Foswiki::Contrib::MailerContrib::WebNotify( 
     220        $twiki, $web, $Foswiki::cfg{NotifyTopicName} ); 
    221221    if ( $wn->isEmpty() ) { 
    222222        print "\t$web has no subscribers\n" if $verbose; 
     
    224224        # create a DB object for parent pointers 
    225225        print $wn->stringify(1) if $verbose; 
    226         my $db = new TWiki::Contrib::MailerContrib::UpData( $twiki, $web ); 
     226        my $db = new Foswiki::Contrib::MailerContrib::UpData( $twiki, $web ); 
    227227        $report .= _processSubscriptions( $twiki, $web, $wn, $db ); 
    228228    } 
     
    235235    my ( $twiki, $web, $notify, $db ) = @_; 
    236236 
    237     my $metadir = TWiki::Func::getWorkArea('MailerContrib'); 
     237    my $metadir = Foswiki::Func::getWorkArea('MailerContrib'); 
    238238    my $notmeta = $web; 
    239239    $notmeta =~ s#/#.#g; 
     
    249249    if ( $verbose ) { 
    250250        print "\tLast notification was at " . 
    251           TWiki::Time::formatTime( $timeOfLastNotify, 'iso' ). "\n"; 
     251          Foswiki::Time::formatTime( $timeOfLastNotify, 'iso' ). "\n"; 
    252252    } 
    253253 
     
    270270    my %allSet; 
    271271 
    272     if( !defined( &TWiki::Func::eachChangeSince )) { 
    273         require TWiki::Contrib::MailerContrib::CompatibilityHacks; 
     272    if( !defined( &Foswiki::Func::eachChangeSince )) { 
     273        require Foswiki::Contrib::MailerContrib::CompatibilityHacks; 
    274274    } 
    275275 
    276276    # + 1 because the 'since' check is >= 
    277     my $it = TWiki::Func::eachChangeSince( $web, $timeOfLastNotify + 1 ); 
     277    my $it = Foswiki::Func::eachChangeSince( $web, $timeOfLastNotify + 1 ); 
    278278    while( $it->hasNext() ) { 
    279279        my $change = $it->next(); 
    280280        next if $change->{more} && $change->{more} =~ /minor$/; 
    281281 
    282         next unless TWiki::Func::topicExists( $web, $change->{topic} ); 
     282        next unless Foswiki::Func::topicExists( $web, $change->{topic} ); 
    283283 
    284284        $timeOfLastChange = $change->{time} unless( $timeOfLastChange ); 
    285285 
    286286        print "\tChange to $change->{topic} at ". 
    287           TWiki::Time::formatTime( $change->{time}, 'iso' ). 
     287          Foswiki::Time::formatTime( $change->{time}, 'iso' ). 
    288288              ". New revision is $change->{revision}\n" if ( $verbose ); 
    289289 
    290290        # Formulate a change record, irrespective of 
    291291        # whether any subscriber is interested 
    292         $change = new TWiki::Contrib::MailerContrib::Change( 
     292        $change = new Foswiki::Contrib::MailerContrib::Change( 
    293293            $twiki, $web, $change->{topic}, $change->{user}, 
    294294            $change->{time}, $change->{revision} ); 
     
    300300    # For each topic, see if there's a compulsory subscription independent 
    301301    # of the time since last notify 
    302     foreach my $topic (TWiki::Func::getTopicList($web)) { 
     302    foreach my $topic (Foswiki::Func::getTopicList($web)) { 
    303303        $notify->processCompulsory( $topic, $db, \%allSet ); 
    304304    } 
     
    307307    my $report = _sendChangesMails( 
    308308        $twiki, $web, \%changeset, 
    309         TWiki::Time::formatTime($timeOfLastNotify) ); 
     309        Foswiki::Time::formatTime($timeOfLastNotify) ); 
    310310 
    311311    $report .= _sendNewsletterMails( $twiki, $web, \%allSet); 
     
    326326    my $report = ''; 
    327327 
    328     my $skin = TWiki::Func::getSkin(); 
    329     my $template = TWiki::Func::readTemplate( 'mailnotify', $skin ); 
    330  
    331     my $homeTopic = $TWiki::cfg{HomeTopicName}; 
    332  
    333     my $before_html = TWiki::Func::expandTemplate( 'HTML:before' ); 
    334     my $middle_html = TWiki::Func::expandTemplate( 'HTML:middle' ); 
    335     my $after_html = TWiki::Func::expandTemplate( 'HTML:after' ); 
    336  
    337     my $before_plain = TWiki::Func::expandTemplate( 'PLAIN:before' ); 
    338     my $middle_plain = TWiki::Func::expandTemplate( 'PLAIN:middle' ); 
    339     my $after_plain = TWiki::Func::expandTemplate( 'PLAIN:after' ); 
    340  
    341     my $mailtmpl = TWiki::Func::expandTemplate( 'MailNotifyBody' ); 
    342     $mailtmpl = TWiki::Func::expandCommonVariables( 
     328    my $skin = Foswiki::Func::getSkin(); 
     329    my $template = Foswiki::Func::readTemplate( 'mailnotify', $skin ); 
     330 
     331    my $homeTopic = $Foswiki::cfg{HomeTopicName}; 
     332 
     333    my $before_html = Foswiki::Func::expandTemplate( 'HTML:before' ); 
     334    my $middle_html = Foswiki::Func::expandTemplate( 'HTML:middle' ); 
     335    my $after_html = Foswiki::Func::expandTemplate( 'HTML:after' ); 
     336 
     337    my $before_plain = Foswiki::Func::expandTemplate( 'PLAIN:before' ); 
     338    my $middle_plain = Foswiki::Func::expandTemplate( 'PLAIN:middle' ); 
     339    my $after_plain = Foswiki::Func::expandTemplate( 'PLAIN:after' ); 
     340 
     341    my $mailtmpl = Foswiki::Func::expandTemplate( 'MailNotifyBody' ); 
     342    $mailtmpl = Foswiki::Func::expandCommonVariables( 
    343343        $mailtmpl, $homeTopic, $web ); 
    344     if( $TWiki::cfg{RemoveImgInMailnotify} ) { 
     344    if( $Foswiki::cfg{RemoveImgInMailnotify} ) { 
    345345        # change images to [alt] text if there, else remove image 
    346346        $mailtmpl =~ s/<img\s[^>]*\balt=\"([^\"]+)[^>]*>/[$1]/goi; 
     
    360360        } 
    361361 
    362         $plain =~ s/\($TWiki::cfg{UsersWebName}\./\(/go; 
     362        $plain =~ s/\($Foswiki::cfg{UsersWebName}\./\(/go; 
    363363 
    364364        my $mail = $mailtmpl; 
     
    368368        $mail =~ s/%PLAIN_TEXT%/$before_plain$plain$after_plain/go; 
    369369        $mail =~ s/%LASTDATE%/$lastTime/geo; 
    370         $mail = TWiki::Func::expandCommonVariables( $mail, $homeTopic, $web ); 
    371  
    372         my $base = $TWiki::cfg{DefaultUrlHost} . $TWiki::cfg{ScriptUrlPath}; 
     370        $mail = Foswiki::Func::expandCommonVariables( $mail, $homeTopic, $web ); 
     371 
     372        my $base = $Foswiki::cfg{DefaultUrlHost} . $Foswiki::cfg{ScriptUrlPath}; 
    373373        $mail =~ s/(href=\")([^"]+)/$1.relativeURL($base,$2)/goei; 
    374374        $mail =~ s/(action=\")([^"]+)/$1.relativeURL($base,$2)/goei; 
     
    377377        $mail =~ s/( ?) *<\/?(nop|noautolink)\/?>\n?/$1/gois; 
    378378 
    379         my $error = TWiki::Func::sendEmail( $mail, 5 ); 
     379        my $error = Foswiki::Func::sendEmail( $mail, 5 ); 
    380380 
    381381        if ($error) { 
     
    410410sub _sendNewsletterMail { 
    411411    my ($twiki, $web, $topic, $emails) = @_; 
    412     my $wikiName = TWiki::Func::getWikiName(); 
     412    my $wikiName = Foswiki::Func::getWikiName(); 
    413413 
    414414    # SMELL: this code is almost identical to PublishContrib 
    415415 
    416416    # Read topic data. 
    417     my ($meta, $text) = TWiki::Func::readTopic( $web, $topic ); 
    418  
    419     if (!defined( &TWiki::Func::pushTopicContext )) { 
    420         require TWiki::Contrib::MailerContrib::TopicContext; 
    421     } 
    422     TWiki::Func::pushTopicContext( $web, $topic ); 
     417    my ($meta, $text) = Foswiki::Func::readTopic( $web, $topic ); 
     418 
     419    if (!defined( &Foswiki::Func::pushTopicContext )) { 
     420        require Foswiki::Contrib::MailerContrib::TopicContext; 
     421    } 
     422    Foswiki::Func::pushTopicContext( $web, $topic ); 
    423423 
    424424    $twiki->enterContext( 'can_render_meta', $meta ); 
    425425 
    426426    # Get the skin for this topic 
    427     my $skin = TWiki::Func::getSkin(); 
    428     TWiki::Func::readTemplate( 'newsletter', $skin ); 
    429     my $header = TWiki::Func::expandTemplate( 'NEWS:header' ); 
    430     my $body = TWiki::Func::expandTemplate( 'NEWS:body' ); 
    431     my $footer = TWiki::Func::expandTemplate( 'NEWS:footer' ); 
     427    my $skin = Foswiki::Func::getSkin(); 
     428    Foswiki::Func::readTemplate( 'newsletter', $skin ); 
     429    my $header = Foswiki::Func::expandTemplate( 'NEWS:header' ); 
     430    my $body = Foswiki::Func::expandTemplate( 'NEWS:body' ); 
     431    my $footer = Foswiki::Func::expandTemplate( 'NEWS:footer' ); 
    432432 
    433433    my ($revdate, $revuser, $maxrev); 
     
    437437    $body =~ s/%TEXT%/$text/g; 
    438438    # Don't render the header, it is preformatted 
    439     $header = TWiki::Func::expandCommonVariables($header, $topic, $web); 
     439    $header = Foswiki::Func::expandCommonVariables($header, $topic, $web); 
    440440    my $tmpl = "$body\n$footer"; 
    441     $tmpl = TWiki::Func::expandCommonVariables($tmpl, $topic, $web); 
    442     $tmpl = TWiki::Func::renderText($tmpl, "", $meta); 
     441    $tmpl = Foswiki::Func::expandCommonVariables($tmpl, $topic, $web); 
     442    $tmpl = Foswiki::Func::renderText($tmpl, "", $meta); 
    443443    $tmpl = "$header$tmpl"; 
    444444 
     
    475475 
    476476    # Rewrite absolute URLs 
    477     my $base = $TWiki::cfg{DefaultUrlHost} . $TWiki::cfg{ScriptUrlPath}; 
     477    my $base = $Foswiki::cfg{DefaultUrlHost} . $Foswiki::cfg{ScriptUrlPath}; 
    478478    $tmpl =~ s/(href=\")([^"]+)/$1.relativeURL($base,$2)/goei; 
    479479    $tmpl =~ s/(action=\")([^"]+)/$1.relativeURL($base,$2)/goei; 
     
    489489        $mail =~ s/%EMAILTO%/$email/go; 
    490490 
    491         my $base = $TWiki::cfg{DefaultUrlHost} . $TWiki::cfg{ScriptUrlPath}; 
     491        my $base = $Foswiki::cfg{DefaultUrlHost} . $Foswiki::cfg{ScriptUrlPath}; 
    492492        $mail =~ s/(href=\")([^"]+)/$1.relativeURL($base,$2)/goei; 
    493493        $mail =~ s/(action=\")([^"]+)/$1.relativeURL($base,$2)/goei; 
     
    496496        $mail =~ s/( ?) *<\/?(nop|noautolink)\/?>\n?/$1/gois; 
    497497 
    498         my $error = TWiki::Func::sendEmail( $mail, 5 ); 
     498        my $error = Foswiki::Func::sendEmail( $mail, 5 ); 
    499499 
    500500        if ($error) { 
     
    508508    $report .= "\t$sentMails newsletters from $web\n"; 
    509509 
    510     TWiki::Func::popTopicContext(); 
     510    Foswiki::Func::popTopicContext(); 
    511511 
    512512    return $report; 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/Change.pm

    r781 r811  
    22# 
    33# Copyright (C) 2004 Wind River Systems Inc. 
    4 # Copyright (C) 1999-2006 TWiki Contributors. 
    5 # All Rights Reserved. TWiki Contributors 
     4# Copyright (C) 1999-2006 Foswiki Contributors. 
     5# All Rights Reserved. Foswiki Contributors 
    66# are listed in the AUTHORS file in the root of this distribution. 
    77# NOTE: Please extend that file, not this notice. 
     
    2323=pod 
    2424 
    25 ---+ package TWiki::Contrib::MailerContrib::Change 
     25---+ package Foswiki::Contrib::MailerContrib::Change 
    2626Object that represents a change to a topic. 
    2727 
    2828=cut 
    2929 
    30 package TWiki::Contrib::MailerContrib::Change; 
    31  
    32 use TWiki; 
     30package Foswiki::Contrib::MailerContrib::Change; 
     31 
     32use Foswiki; 
    3333 
    3434use URI::Escape; 
     
    5757    my $user; 
    5858    # SMELL: call to unpublished core function 
    59     if (defined(&TWiki::Users::findUser)) { 
     59    if (defined(&Foswiki::Users::findUser)) { 
    6060        $user = $session->{users}->findUser( $author, undef, 1 ); 
    6161        $this->{AUTHOR} = $user ? $user->wikiName() : $author; 
    6262    } else { 
    63         $this->{AUTHOR} = TWiki::Func::getWikiName($author); 
     63        $this->{AUTHOR} = Foswiki::Func::getWikiName($author); 
    6464    } 
    6565    $this->{TIME} = $time; 
     
    9090sub merge { 
    9191    my( $this, $other ) = @_; 
    92     ASSERT($this->isa( 'TWiki::Contrib::MailerContrib::Change' )) if DEBUG; 
    93     ASSERT($other->isa( 'TWiki::Contrib::MailerContrib::Change' )) if DEBUG; 
     92    ASSERT($this->isa( 'Foswiki::Contrib::MailerContrib::Change' )) if DEBUG; 
     93    ASSERT($other->isa( 'Foswiki::Contrib::MailerContrib::Change' )) if DEBUG; 
    9494 
    9595    if( $other->{CURR_REV} > $this->{CURR_REV} ) { 
     
    119119 
    120120    unless( defined $this->{HTML_SUMMARY} ) { 
    121         if( defined &TWiki::Func::summariseChanges ) { 
     121        if( defined &Foswiki::Func::summariseChanges ) { 
    122122            $this->{HTML_SUMMARY} = 
    123               TWiki::Func::summariseChanges( 
     123              Foswiki::Func::summariseChanges( 
    124124                  $this->{WEB}, $this->{TOPIC}, $this->{BASE_REV}, 
    125125                  $this->{CURR_REV}, 1 ); 
     
    134134    $html =~ s/%TOPICNAME%/$this->{TOPIC}/g; 
    135135    $html =~ s/%AUTHOR%/$this->{AUTHOR}/g; 
    136     my $tim =  TWiki::Time::formatTime( $this->{TIME} ); 
     136    my $tim =  Foswiki::Time::formatTime( $this->{TIME} ); 
    137137    $html =~ s/%TIME%/$tim/go; 
    138138    $html =~ s/%CUR_REV%/$this->{CURR_REV}/g; 
     
    149149    } 
    150150    $html =~ s/%REVISION%/$frev/g; 
    151     $html = TWiki::Func::expandCommonVariables( 
     151    $html = Foswiki::Func::expandCommonVariables( 
    152152        $html, $this->{TOPIC}, $this->{WEB} ); 
    153     $html = TWiki::Func::renderText( $html ); 
     153    $html = Foswiki::Func::renderText( $html ); 
    154154    $html =~ s/%TEXTHEAD%/$this->{HTML_SUMMARY}/g; 
    155155 
     
    169169    unless( defined $this->{TEXT_SUMMARY} ) { 
    170170        my $s; 
    171         if( defined &TWiki::Func::summariseChanges ) { 
    172             $s = TWiki::Func::summariseChanges( 
     171        if( defined &Foswiki::Func::summariseChanges ) { 
     172            $s = Foswiki::Func::summariseChanges( 
    173173                $this->{WEB}, $this->{TOPIC}, $this->{BASE_REV}, 
    174174                $this->{CURR_REV}, 0 ); 
     
    183183    } 
    184184 
    185     my $tim =  TWiki::Time::formatTime( $this->{TIME} ); 
     185    my $tim =  Foswiki::Time::formatTime( $this->{TIME} ); 
    186186 
    187187    # URL-encode topic names for use of I18N topic names in plain text 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/CompatibilityHacks.pm

    r14 r811  
    2828} 
    2929 
    30 package TWiki::Func; 
     30package Foswiki::Func; 
    3131 
    3232sub eachChangeSince { 
     
    3434 
    3535    my $changes; 
    36     if( open(F, "<$TWiki::cfg{DataDir}/$web/.changes")) { 
     36    if( open(F, "<$Foswiki::cfg{DataDir}/$web/.changes")) { 
    3737        local $/ = undef; 
    3838        $changes = <F>; 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/Config.spec

    r14 r811  
    99# If this is not defined, then the default setting of 
    1010# =[A-Za-z0-9.+-_]+\@[A-Za-z0-9.-]+= is used. 
    11 $TWiki::cfg{MailerContrib}{EmailFilterIn} = ''; 
     11$Foswiki::cfg{MailerContrib}{EmailFilterIn} = ''; 
    1212 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/MANIFEST

    r14 r811  
    1 lib/TWiki/Contrib/MailerContrib/Config.spec 0444 Spec file for =configure= 
    2 lib/TWiki/Contrib/MailerContrib/WebNotify.pm 0444 
    3 lib/TWiki/Contrib/MailerContrib/Subscriber.pm 0444 
    4 lib/TWiki/Contrib/MailerContrib/Subscription.pm 0444 
    5 lib/TWiki/Contrib/MailerContrib/TopicContext.pm 0444 
    6 lib/TWiki/Contrib/MailerContrib/Change.pm 0444 
    7 lib/TWiki/Contrib/MailerContrib/Constants.pm 0444 
    8 lib/TWiki/Contrib/MailerContrib/UpData.pm 0444 
    9 lib/TWiki/Contrib/MailerContrib/CompatibilityHacks.pm 0444 
    10 lib/TWiki/Contrib/MailerContrib.pm 0444 
    11 data/TWiki/MailerContrib.txt 0644 
     1lib/Foswiki/Contrib/MailerContrib/Config.spec 0444 Spec file for =configure= 
     2lib/Foswiki/Contrib/MailerContrib/WebNotify.pm 0444 
     3lib/Foswiki/Contrib/MailerContrib/Subscriber.pm 0444 
     4lib/Foswiki/Contrib/MailerContrib/Subscription.pm 0444 
     5lib/Foswiki/Contrib/MailerContrib/TopicContext.pm 0444 
     6lib/Foswiki/Contrib/MailerContrib/Change.pm 0444 
     7lib/Foswiki/Contrib/MailerContrib/Constants.pm 0444 
     8lib/Foswiki/Contrib/MailerContrib/UpData.pm 0444 
     9lib/Foswiki/Contrib/MailerContrib/CompatibilityHacks.pm 0444 
     10lib/Foswiki/Contrib/MailerContrib.pm 0444 
     11data/System/MailerContrib.txt 0644 
    1212tools/mailnotify 0555 
    1313templates/mailnotify.tmpl 0444 
    1414templates/newsletter.tmpl 0444 
    15 pub/TWiki/MailerContrib/wikiringlogo20x20.png 0660 
    16 pub/TWiki/MailerContrib/logo.gif 0660 
     15pub/System/MailerContrib/wikiringlogo20x20.png 0660 
     16pub/System/MailerContrib/logo.gif 0660 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/Subscriber.pm

    r781 r811  
    22# 
    33# Copyright (C) 2004 Wind River Systems Inc. 
    4 # Copyright (C) 1999-2006 TWiki Contributors. 
    5 # All Rights Reserved. TWiki Contributors 
     4# Copyright (C) 1999-2006 Foswiki Contributors. 
     5# All Rights Reserved. Foswiki Contributors 
    66# are listed in the AUTHORS file in the root of this distribution. 
    77# NOTE: Please extend that file, not this notice. 
     
    2323=pod 
    2424 
    25 ---+ package TWiki::Contrib::MailerContrib::Subscriber 
     25---+ package Foswiki::Contrib::MailerContrib::Subscriber 
    2626Object that represents a subscriber to notification. A subscriber is 
    2727a name (which may be a wikiName or an email address) and a list of 
     
    3333=cut 
    3434 
    35 package TWiki::Contrib::MailerContrib::Subscriber; 
    36  
    37 use TWiki; 
    38 use TWiki::Plugins; 
     35package Foswiki::Contrib::MailerContrib::Subscriber; 
     36 
     37use Foswiki; 
     38use Foswiki::Plugins; 
    3939use Assert; 
    4040 
    41 require TWiki::Contrib::MailerContrib::WebNotify; 
     41require Foswiki::Contrib::MailerContrib::WebNotify; 
    4242 
    4343=pod 
     
    8787    return $emails unless $name; 
    8888 
    89     if ( $name =~ /^$TWiki::cfg{MailerContrib}{EmailFilterIn}$/ ) { 
     89    if ( $name =~ /^$Foswiki::cfg{MailerContrib}{EmailFilterIn}$/ ) { 
    9090        push( @{$emails}, $name ); 
    9191    } else { 
    92         my $users = $TWiki::Plugins::SESSION->{users}; 
     92        my $users = $Foswiki::Plugins::SESSION->{users}; 
    9393        if ($users->can('findUserByWikiName')) { 
    9494            # User is represented by a wikiname. Map to a canonical 
     
    210210---++ isSubscribedTo($topic, $db) -> $subscription 
    211211   * =$topic= - Topic object we are checking 
    212    * =$db= - TWiki::Contrib::MailerContrib::UpData database of parents 
     212   * =$db= - Foswiki::Contrib::MailerContrib::UpData database of parents 
    213213Check if we have a subscription to the given topic. Return the subscription 
    214214that matches if we do, undef otherwise. 
     
    232232---++ isUnsubscribedFrom($topic) -> $subscription 
    233233   * =$topic= - Topic object we are checking 
    234    * =$db= - TWiki::Contrib::MailerContrib::UpData database of parents 
     234   * =$db= - Foswiki::Contrib::MailerContrib::UpData database of parents 
    235235Check if we have an unsubscription from the given topic. Return the subscription that matches if we do, undef otherwise. 
    236236 
     
    267267 
    268268    my $name = $this->{name}; 
    269     if ($name =~ /^$TWiki::regex{wikiWordRegex}$/) { 
     269    if ($name =~ /^$Foswiki::regex{wikiWordRegex}$/) { 
    270270        $name = '%USERSWEB%.'.$name; 
    271     } elsif ($name !~ /^$TWiki::cfg{MailerContrib}{EmailFilterIn})$/) { 
     271    } elsif ($name !~ /^$Foswiki::cfg{MailerContrib}{EmailFilterIn})$/) { 
    272272        $name = $name =~ /'/ ? '"'.$name.'"' : "'$name'"; 
    273273    } 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/Subscription.pm

    r781 r811  
    22# 
    33# Copyright (C) 2004 Wind River Systems Inc. 
    4 # Copyright (C) 1999-2006 TWiki Contributors. 
    5 # All Rights Reserved. TWiki Contributors 
     4# Copyright (C) 1999-2006 Foswiki Contributors. 
     5# All Rights Reserved. Foswiki Contributors 
    66# are listed in the AUTHORS file in the root of this distribution. 
    77# NOTE: Please extend that file, not this notice. 
     
    1414=pod 
    1515 
    16 ---+ package TWiki::Contrib::MailerContrib::Subscription 
     16---+ package Foswiki::Contrib::MailerContrib::Subscription 
    1717Object that represents a single subscription of a user to 
    1818notification on a page. A subscription is expressed as a page 
     
    2222=cut 
    2323 
    24 package TWiki::Contrib::MailerContrib::Subscription; 
     24package Foswiki::Contrib::MailerContrib::Subscription; 
    2525 
    2626use Assert; 
    2727 
    28 use TWiki::Contrib::MailerContrib::Constants; 
     28use Foswiki::Contrib::MailerContrib::Constants; 
    2929 
    3030=pod 
     
    7878---++ matches($topic, $db, $depth) -> boolean 
    7979   * =$topic= - Topic object we are checking 
    80    * =$db= - TWiki::Contrib::MailerContrib::UpData database of parent names 
     80   * =$db= - Foswiki::Contrib::MailerContrib::UpData database of parent names 
    8181   * =$depth= - If non-zero, check if the parent of the given topic matches as well. undef = 0. 
    8282Check if we match this topic. Recurses up the parenthood tree seeing if 
     
    109109---++ covers($other, $db) -> $boolean 
    110110   * =$other= - Other subscription object we are checking 
    111    * =$db= - TWiki::Contrib::MailerContrib::UpData database of parent names 
     111   * =$db= - Foswiki::Contrib::MailerContrib::UpData database of parent names 
    112112Return true if this subscription already covers all the topics 
    113113specified by another subscription. Thus: 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/TopicContext.pm

    r14 r811  
    22# by MailerContrib. 
    33 
    4 sub TWiki::Func::pushTopicContext { 
     4sub Foswiki::Func::pushTopicContext { 
    55    my( $web, $topic ) = @_; 
    6     my $twiki = $TWiki::Plugins::SESSION; 
     6    my $twiki = $Foswiki::Plugins::SESSION; 
    77    my( $web, $topic ) = $twiki->normalizeWebTopicName( @_ ); 
    88    my $old = { 
     
    2020} 
    2121 
    22 sub TWiki::Func::popTopicContext { 
    23     my $twiki = $TWiki::Plugins::SESSION; 
     22sub Foswiki::Func::popTopicContext { 
     23    my $twiki = $Foswiki::Plugins::SESSION; 
    2424    my $old = pop( @{$twiki->{_FUNC_PREFS_STACK}} ); 
    2525    $twiki->{prefs}->restore( $old->{mark}); 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/UpData.pm

    r781 r811  
    22# 
    33# Copyright (C) 2004 Wind River Systems Inc. 
    4 # Copyright (C) 1999-2006 TWiki Contributors. 
    5 # All Rights Reserved. TWiki Contributors 
     4# Copyright (C) 1999-2006 Foswiki Contributors. 
     5# All Rights Reserved. Foswiki Contributors 
    66# are listed in the AUTHORS file in the root of this distribution. 
    77# NOTE: Please extend that file, not this notice. 
     
    2323=pod 
    2424 
    25 ---+ package TWiki::Contrib::MailerContrib::UpData 
     25---+ package Foswiki::Contrib::MailerContrib::UpData 
    2626Object that lazy-scans topics to extract 
    2727parent relationships. 
     
    2929=cut 
    3030 
    31 package TWiki::Contrib::MailerContrib::UpData; 
     31package Foswiki::Contrib::MailerContrib::UpData; 
    3232 
    3333=pod 
     
    6060    if ( ! defined( $this->{parent}{$topic} )) { 
    6161        my( $meta, $text ) = 
    62           TWiki::Func::readTopic( $this->{web}, $topic ); 
     62          Foswiki::Func::readTopic( $this->{web}, $topic ); 
    6363        my $parent = $meta->get('TOPICPARENT'); 
    6464        $this->{parent}{$topic} = $parent->{name} if $parent; 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/WebNotify.pm

    r781 r811  
    22# 
    33# Copyright (C) 2004 Wind River Systems Inc. 
    4 # Copyright (C) 1999-2007 TWiki Contributors. 
    5 # All Rights Reserved. TWiki Contributors 
     4# Copyright (C) 1999-2007 Foswiki Contributors. 
     5# All Rights Reserved. Foswiki Contributors 
    66# are listed in the AUTHORS file in the root of this distribution. 
    77# NOTE: Please extend that file, not this notice. 
     
    2121=pod 
    2222 
    23 ---+ package TWiki::Contrib::MailerContrib::WebNotify 
     23---+ package Foswiki::Contrib::MailerContrib::WebNotify 
    2424Object that represents the contents of a %NOTIFYTOPIC% topic in a TWiki web. 
    2525 
    26 Note that =$TWiki::Plugins::SESSION= is used to find the TWiki session, and 
     26Note that =$Foswiki::Plugins::SESSION= is used to find the TWiki session, and 
    2727must be set up before this class is used. 
    2828 
    2929=cut 
    3030 
    31 package TWiki::Contrib::MailerContrib::WebNotify; 
     31package Foswiki::Contrib::MailerContrib::WebNotify; 
    3232 
    3333use strict; 
     
    3636use Assert; 
    3737 
    38 require TWiki::Func; 
    39 require TWiki::Contrib::MailerContrib; 
    40 require TWiki::Contrib::MailerContrib::Subscriber; 
    41 require TWiki::Contrib::MailerContrib::Subscription; 
     38require Foswiki::Func; 
     39require Foswiki::Contrib::MailerContrib; 
     40require Foswiki::Contrib::MailerContrib::Subscriber; 
     41require Foswiki::Contrib::MailerContrib::Subscription; 
    4242 
    4343=pod 
     
    6262 
    6363    # Ensure the contrib is initialised 
    64     TWiki::Contrib::MailerContrib::initContrib(); 
     64    Foswiki::Contrib::MailerContrib::initContrib(); 
    6565 
    6666    $this->{web} = $web; 
    67     $this->{topic} = $topic || $TWiki::cfg{NotifyTopicName} || 'WebNotify'; 
     67    $this->{topic} = $topic || $Foswiki::cfg{NotifyTopicName} || 'WebNotify'; 
    6868    $this->{pretext} = ''; 
    6969    $this->{posttext} = ''; 
     
    7171    $this->{noexpandgroups} = $noexpandgroups; 
    7272 
    73     if( TWiki::Func::topicExists( $web, $topic )) { 
     73    if( Foswiki::Func::topicExists( $web, $topic )) { 
    7474        $this->_load(); 
    7575    } 
     
    8989sub writeWebNotify { 
    9090    my $this = shift; 
    91     TWiki::Func::saveTopicText( 
     91    Foswiki::Func::saveTopicText( 
    9292        $this->{web}, 
    9393        $this->{topic}, 
     
    114114    unless ( $noAdd || defined( $subscriber )) { 
    115115        $subscriber = 
    116           new TWiki::Contrib::MailerContrib::Subscriber( $name ); 
     116          new Foswiki::Contrib::MailerContrib::Subscriber( $name ); 
    117117        $this->{subscribers}{$name} = $subscriber; 
    118118    } 
     
    151151    my @names = ($name); 
    152152    unless ($this->{noexpandgroups}) { 
    153         if (defined &TWiki::Func::eachGroupMember) { 
    154             my $it = TWiki::Func::eachGroupMember( $name ); 
     153        if (defined &Foswiki::Func::eachGroupMember) { 
     154            my $it = Foswiki::Func::eachGroupMember( $name ); 
    155155            if( $it ) { 
    156156                @names = (); 
     
    161161            } 
    162162        } else { 
    163             my $user = TWiki::User->new($this->{session}, '', $name); 
     163            my $user = Foswiki::User->new($this->{session}, '', $name); 
    164164            if ($user->isGroup) { 
    165165                @names = map {$_->wikiName} @{$user->groupMembers}; 
     
    170170    foreach my $n (@names) { 
    171171        my $subscriber = $this->getSubscriber( $n ); 
    172         my $sub = new TWiki::Contrib::MailerContrib::Subscription( 
     172        my $sub = new Foswiki::Contrib::MailerContrib::Subscription( 
    173173            $topics, $depth, $opts ); 
    174174        $subscriber->subscribe( $sub ); 
     
    193193    my @names = ( $name ); 
    194194    unless ($this->{noexpandgroups}) { 
    195         if (defined &TWiki::Func::eachGroupMember) { 
    196             my $it = TWiki::Func::eachGroupMember( $name ); 
     195        if (defined &Foswiki::Func::eachGroupMember) { 
     196            my $it = Foswiki::Func::eachGroupMember( $name ); 
    197197            if( $it ) { 
    198198                @names = (); 
     
    203203            } 
    204204        } else { 
    205             my $user = TWiki::User->new($this->{session}, '', $name); 
     205            my $user = Foswiki::User->new($this->{session}, '', $name); 
    206206            if ($user->isGroup) { 
    207207                @names = map {$_->wikiName} @{$user->groupMembers}; 
     
    212212    foreach my $n (@names) { 
    213213        my $subscriber = $this->getSubscriber( $n ); 
    214         my $sub = new TWiki::Contrib::MailerContrib::Subscription( 
     214        my $sub = new Foswiki::Contrib::MailerContrib::Subscription( 
    215215            $topics, $depth, 0 ); 
    216216        $subscriber->unsubscribe( $sub ); 
     
    247247 
    248248---++ processChange($change, $db, $changeSet, $seenSet, $allSet) 
    249    * =$change= - ref of a TWiki::Contrib::Mailer::Change 
    250    * =$db= - TWiki::Contrib::MailerContrib::UpData database of parent references 
     249   * =$change= - ref of a Foswiki::Contrib::Mailer::Change 
     250   * =$db= - Foswiki::Contrib::MailerContrib::UpData database of parent references 
    251251   * =$changeSet= - ref of a hash mapping emails to sets of changes 
    252252   * =$seenSet= - ref of a hash recording indices of topics already seen 
     
    264264    my $web = $change->{WEB}; 
    265265    my %authors = map { $_ => 1 } 
    266       @{TWiki::Contrib::MailerContrib::Subscriber::getEmailAddressesForUser( 
     266      @{Foswiki::Contrib::MailerContrib::Subscriber::getEmailAddressesForUser( 
    267267          $change->{author})}; 
    268268 
     
    272272        if ($subs && !$subscriber->isUnsubscribedFrom( $topic, $db )) { 
    273273 
    274             next unless TWiki::Func::checkAccessPermission( 
     274            next unless Foswiki::Func::checkAccessPermission( 
    275275                'VIEW', $name, undef, $topic, $this->{web}, undef ); 
    276276 
     
    306306---++ processCompulsory($topic, $db, \%allSet) 
    307307   * =$topic= - topic name 
    308    * =$db= - TWiki::Contrib::MailerContrib::UpData database of parent references 
     308   * =$db= - Foswiki::Contrib::MailerContrib::UpData database of parent references 
    309309   * =\%allSet= - ref of a hash that maps topics to email addresses for news subscriptions 
    310310 
     
    346346    my $this = shift; 
    347347 
    348     my ( $meta, $text ) = TWiki::Func::readTopic( 
     348    my ( $meta, $text ) = Foswiki::Func::readTopic( 
    349349        $this->{web}, $this->{topic} ); 
    350350    my $in_pre = 1; 
     
    354354    # join \ terminated lines 
    355355    $text =~ s/\\\r?\n//gs; 
    356     my $webRE = qr/(?:$TWiki::cfg{UsersWebName}\.)?/o; 
     356    my $webRE = qr/(?:$Foswiki::cfg{UsersWebName}\.)?/o; 
    357357    foreach my $baseline ( split ( /\r?\n/, $text )) { 
    358         my $line = TWiki::Func::expandCommonVariables( 
     358        my $line = Foswiki::Func::expandCommonVariables( 
    359359            $baseline, $this->{topic}, $this->{web}, $meta); 
    360         if( $line =~ /^\s+\*\s$webRE($TWiki::regex{wikiWordRegex})\s+\-\s+($TWiki::cfg{MailerContrib}{EmailFilterIn}+)\s*$/o 
    361               && $1 ne $TWiki::cfg{DefaultUserWikiName}) { 
     360        if( $line =~ /^\s+\*\s$webRE($Foswiki::regex{wikiWordRegex})\s+\-\s+($Foswiki::cfg{MailerContrib}{EmailFilterIn}+)\s*$/o 
     361              && $1 ne $Foswiki::cfg{DefaultUserWikiName}) { 
    362362            # Main.WikiName - email@domain (legacy format) 
    363363            $this->subscribe( $2, '*', 0, 0 ); 
    364364            $in_pre = 0; 
    365365        } 
    366         elsif ( $line =~ /^\s+\*\s$webRE($TWiki::regex{wikiWordRegex}|'.*?'|".*?"|$TWiki::cfg{MailerContrib}{EmailFilterIn})\s*(:.*)?$/o 
    367                   && $1 ne $TWiki::cfg{DefaultUserWikiName}) { 
     366        elsif ( $line =~ /^\s+\*\s$webRE($Foswiki::regex{wikiWordRegex}|'.*?'|".*?"|$Foswiki::cfg{MailerContrib}{EmailFilterIn})\s*(:.*)?$/o 
     367                  && $1 ne $Foswiki::cfg{DefaultUserWikiName}) { 
    368368            my $subscriber = $1; 
    369369            # Get the topic list from the last bracket matched. Have to do it 
     
    397397    $this->{topicSub} = \&_subscribeTopic; 
    398398     
    399     my $ret = TWiki::Contrib::MailerContrib::parsePageList($this, $who, $spec, $unsubscribe); 
     399    my $ret = Foswiki::Contrib::MailerContrib::parsePageList($this, $who, $spec, $unsubscribe); 
    400400    if ( $ret =~ m/\S/ ) { 
    401         TWiki::Func::writeWarning( 
     401        Foswiki::Func::writeWarning( 
    402402            "Badly formatted page list at $who: $spec"); 
    403403        return -1; 
     
    409409    my ( $this, $who, $unsubscribe, $webTopic, $options, $childDepth ) = @_; 
    410410     
    411     my ($web, $topic) = TWiki::Func::normalizeWebTopicName($this->{web}, $webTopic); 
     411    my ($web, $topic) = Foswiki::Func::normalizeWebTopicName($this->{web}, $webTopic); 
    412412     
    413413#print STDERR "_subscribeTopic($topic)\n"; 
     
    438438    unless (defined $this->{nomail}{$name}) { 
    439439        $this->{nomail}{$name} = 1; 
    440         TWiki::Func::writeWarning( 
     440        Foswiki::Func::writeWarning( 
    441441            "Failed to find permitted email for '". 
    442442              $subscriber->stringify()."' when processing web '$web'"); 
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/build.pl

    r736 r811