Ignore:
Timestamp:
10/15/09 19:28:59 (3 years ago)
Author:
KennethLavrsen
Message:

Item2260: MailerContrib cannot find email templates based on skin or web
The checkin does the following

  • It makes a tiny little fix in MailerContrib.pm where I pushTopicContext before loading mail template and pop it again afterwards
  • Updates the the documentation to show by example how to tailor the mail message
  • Merge over the code from trunk. This introduces a bug fix from Item1603 which for some reason was only applied to trunk
  • And with this merge also merge over a lot of perl tinying.

It was too difficult to separate the two once I was this far. Look at next checkin in trunk to see only the actual code changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Release01x00/MailerContrib/lib/Foswiki/Contrib/MailerContrib/TopicContext.pm

    r1437 r5269  
    22# by MailerContrib. 
    33 
     4use strict; 
     5 
    46sub Foswiki::Func::pushTopicContext { 
    5     my( $web, $topic ) = @_; 
     7    my ( $web, $topic ) = @_; 
    68    my $session = $Foswiki::Plugins::SESSION; 
    7     my( $web, $topic ) = $session->normalizeWebTopicName( @_ ); 
     9    my ( $web, $topic ) = $session->normalizeWebTopicName(@_); 
    810    my $old = { 
    9         web => $session->{webName}, 
     11        web   => $session->{webName}, 
    1012        topic => $session->{topicName}, 
    11         mark => $session->{prefs}->mark() }; 
     13        mark  => $session->{prefs}->mark() 
     14    }; 
    1215 
    13     push( @{$session->{_FUNC_PREFS_STACK}}, $old ); 
    14     $session->{webName} = $web; 
     16    push( @{ $session->{_FUNC_PREFS_STACK} }, $old ); 
     17    $session->{webName}   = $web; 
    1518    $session->{topicName} = $topic; 
    16     $session->{prefs}->pushWebPreferences( $web ); 
     19    $session->{prefs}->pushWebPreferences($web); 
    1720    $session->{prefs}->pushPreferences( $web, $topic, 'TOPIC' ); 
    18     $session->{prefs}->pushPreferenceValues( 
    19         'SESSION', $session->{loginManager}->getSessionValues() ); 
     21    $session->{prefs}->pushPreferenceValues( 'SESSION', 
     22        $session->{loginManager}->getSessionValues() ); 
    2023} 
    2124 
    2225sub Foswiki::Func::popTopicContext { 
    2326    my $session = $Foswiki::Plugins::SESSION; 
    24     my $old = pop( @{$session->{_FUNC_PREFS_STACK}} ); 
    25     $session->{prefs}->restore( $old->{mark}); 
    26     $session->{webName} = $old->{web}; 
     27    my $old     = pop( @{ $session->{_FUNC_PREFS_STACK} } ); 
     28    $session->{prefs}->restore( $old->{mark} ); 
     29    $session->{webName}   = $old->{web}; 
    2730    $session->{topicName} = $old->{topic}; 
    2831} 
Note: See TracChangeset for help on using the changeset viewer.