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/CompatibilityHacks.pm

    r1340 r5269  
    44package IteratorHack; 
    55 
     6use strict; 
     7 
    68sub new { 
    7     my ($class, $list) = @_; 
    8     my $this = bless({list => $list, index => 0, next => undef }, $class); 
     9    my ( $class, $list ) = @_; 
     10    my $this = bless( { list => $list, index => 0, next => undef }, $class ); 
    911    return $this; 
    1012} 
    1113 
    1214sub hasNext { 
    13     my( $this ) = @_; 
     15    my ($this) = @_; 
    1416    return 1 if $this->{next}; 
    15     if( $this->{index} < scalar(@{$this->{list}}) ) { 
    16         $this->{next} = $this->{list}->[$this->{index}++]; 
     17    if ( $this->{index} < scalar( @{ $this->{list} } ) ) { 
     18        $this->{next} = $this->{list}->[ $this->{index}++ ]; 
    1719        return 1; 
    1820    } 
     
    3133 
    3234sub eachChangeSince { 
    33     my ($web, $since) = @_; 
     35    my ( $web, $since ) = @_; 
    3436 
    3537    my $changes; 
    36     if( open(F, "<$Foswiki::cfg{DataDir}/$web/.changes")) { 
     38    if ( open( F, '<', "$Foswiki::cfg{DataDir}/$web/.changes" ) ) { 
    3739        local $/ = undef; 
    3840        $changes = <F>; 
     
    4446    my @changes = 
    4547      map { 
    46           # Create a hash for this line 
    47           { topic => $_->[0], user => $_->[1], time => $_->[2], 
    48               revision => $_->[3], more => $_->[4] }; 
     48 
     49        # Create a hash for this line 
     50        { 
     51            topic    => $_->[0], 
     52            user     => $_->[1], 
     53            time     => $_->[2], 
     54            revision => $_->[3], 
     55            more     => $_->[4] 
     56        }; 
    4957      } 
    50         grep { 
    51             # Filter on time 
    52             $_->[2] && $_->[2] >= $since 
    53         } 
    54           map { 
    55               # Split line into an array 
    56               my @row = split(/\t/, $_, 5); 
    57               \@row; 
    58           } 
    59             reverse split( /[\r\n]+/, $changes); 
     58      grep { 
     59 
     60        # Filter on time 
     61        $_->[2] && $_->[2] >= $since 
     62      } 
     63      map { 
     64 
     65        # Split line into an array 
     66        my @row = split( /\t/, $_, 5 ); 
     67        \@row; 
     68      } 
     69      reverse split( /[\r\n]+/, $changes ); 
    6070 
    6171    return new IteratorHack( \@changes ); 
Note: See TracChangeset for help on using the changeset viewer.