Ignore:
Timestamp:
11/19/08 15:00:00 (4 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/InterwikiPlugin/lib/Foswiki
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.