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/MailerContrib/lib/Foswiki
Files:
1 edited
1 moved

Legend:

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