Changeset 790 for trunk


Ignore:
Timestamp:
May 19, 2006, 12:08:19 PM (15 years ago)
Author:
nick
Message:

Pass the requested feed listing through all the feeds code, rather than just assuming it's recent_changes

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      .vimrc
      *.swp
  • trunk/Changes

    r789 r790  
    11"#" items refer to tickets. See <http://dev.openguides.org/report/9> for details.
     2
     30.54_02
     4        Pass the feed_listing (currently just recent_changes) through all
     5        the feed related code, rather than assuming it'll only ever be
     6        recent changes. Will allow other listings of nodes to be handled
     7        in the future.
    28
    390.54_01 16 May 2006
  • trunk/lib/OpenGuides.pm

    r787 r790  
    646646  $guide->display_feed(
    647647                         feed_type          => 'rss',
     648                         feed_listing       => 'recent_changes',
    648649                         items              => 10,
    649650                         ignore_minor_edits => 1,
     
    653654  # All edits bob has made to pub pages in the last week in Atom format
    654655  $guide->display_feed(
    655                          feed_type => 'atom',
    656                          days      => 7,
    657                          username  => "bob",
    658                          category  => "Pubs",
     656                         feed_type    => 'atom',
     657                         feed_listing => 'recent_changes',
     658                         days         => 7,
     659                         username     => "bob",
     660                         category     => "Pubs",
    659661                     );
    660662
     
    662664"rss" and "atom".
    663665
     666C<feed_listing> is a mandatory parameter. Supported values at present
     667are "recent_changes". (More values are coming soon though!)
     668
    664669As with other methods, the C<return_output> parameter can be used to
    665670return the output instead of printing it to STDOUT.
     
    672677    my $feed_type = $args{feed_type};
    673678    croak "No feed type given" unless $feed_type;
     679
     680    my $feed_listing = $args{feed_listing};
     681    croak "No feed listing given" unless $feed_listing;
    674682   
    675683    my $return_output = $args{return_output} ? 1 : 0;
     
    686694                       ignore_minor_edits => $ignore_minor_edits,
    687695                       feed_type          => $feed_type,
     696                       feed_listing       => $feed_listing,
    688697                   );
    689698    my %filter;
  • trunk/lib/OpenGuides/Feed.pm

    r785 r790  
    6161   
    6262    my $feed_type = $args{feed_type};
     63    my $feed_listing = $args{feed_listing};
    6364   
    6465    my %known_types = (
     
    6667                          'atom' => 1,
    6768                      );
     69    my %known_listings = (
     70                          'recent_changes' => 1,
     71                         );
    6872                     
    6973    croak "No feed type specified" unless $feed_type;
    7074    croak "Unknown feed type: $feed_type" unless $known_types{$feed_type};
    7175
     76    croak "No feed listing specified" unless $feed_listing;
     77    croak "Unknown feed listing: $feed_listing" unless $known_listings{$feed_listing};
     78
    7279    if ($feed_type eq 'rss') {
    73         return $self->rss_maker->recent_changes(%args);
     80        if ($feed_listing eq 'recent_changes') {
     81            return $self->rss_maker->recent_changes(%args);
     82        }
    7483    }
    7584    elsif ($feed_type eq 'atom') {
    76         return $self->atom_maker->recent_changes(%args);
     85        if ($feed_listing eq 'recent_changes') {
     86            return $self->atom_maker->recent_changes(%args);
     87        }
    7788    }
    7889}
  • trunk/t/22_rss_modwiki.t

    r785 r790  
    4646                                  config => $config );
    4747
    48 my $rss = eval { $feed->make_feed(feed_type => 'rss'); };
     48my $rss = eval { $feed->make_feed(feed_type => 'rss', feed_listing => 'recent_changes'); };
    4949is( $@, "", "->make_feed for rss doesn't croak" );
    5050
     
    100100$output = $guide->display_feed(
    101101                               feed_type          => "rss",
     102                               feed_listing       => "recent_changes",
    102103                               items              => 5,
    103104                               username           => "bob",
  • trunk/wiki.cgi

    r788 r790  
    105105                               category locale );
    106106                $args{feed_type} = 'rss';
     107                $args{feed_listing} = 'recent_changes';
    107108                $guide->display_feed( %args );
    108109            } elsif ( $feed eq "chef_dan" ) {
     
    116117                           category locale );
    117118            $args{feed_type} = 'atom';
     119            $args{feed_listing} = 'recent_changes';
    118120            $guide->display_feed( %args );
    119121        } else {
Note: See TracChangeset for help on using the changeset viewer.