Show
Ignore:
Timestamp:
05/25/06 17:46:22 (6 years ago)
Author:
nick
Message:

Add an option to also return the feed timestamp

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed/Atom.pm

    r312 r314  
    5555using any supplied parameters to narrow the results. 
    5656 
     57If the argument "also_return_timestamp" is supplied, it will return an 
     58array of the feed, and the feed timestamp. Otherwise it just returns the feed. 
     59 
    5760=cut 
    5861sub recent_changes 
     
    6568    ); 
    6669 
    67     return $self->generate_node_list_feed($atom_timestamp, @changes); 
     70    my $feed = $self->generate_node_list_feed($atom_timestamp, @changes); 
     71 
     72    if($args{'also_return_timestamp'}) { 
     73        return ($feed,$feed_timestamp); 
     74    } else { 
     75        return $feed; 
     76    } 
    6877} 
    6978 
     
    7281 
    7382Build an Atom Feed of all the different versions of a given node. 
     83 
     84If the argument "also_return_timestamp" is supplied, it will return an 
     85array of the feed, and the feed timestamp. Otherwise it just returns the feed. 
    7486 
    7587=cut 
     
    8193    my $feed_timestamp = $self->feed_timestamp( $all_versions[0] ); 
    8294 
    83     return $self->generate_node_list_feed($feed_timestamp, @all_versions); 
     95    my $feed = $self->generate_node_list_feed($feed_timestamp, @all_versions); 
     96 
     97    if($args{'also_return_timestamp'}) { 
     98        return ($feed,$feed_timestamp); 
     99    } else { 
     100        return $feed; 
     101    } 
    84102}  
    85103