. It accepts a named argument C<'num_items'> which
defaults to 10.
=cut
sub format_news_page_item
{
my $self = shift;
my (%args) = (@_);
my $item = $args{'item'};
my $base_url = $args{'base_url'};
return "\n" .
"\n" . $item->description() . "\n
\n";
}
sub get_news_page_entries
{
my $self = shift;
my %args = (@_);
my $html = "";
my $base_url = exists($args{'base_url'}) ? $args{'base_url'} : "";
foreach my $single_item (reverse(@{$self->get_items_to_include(\%args)}))
{
$html .=
$self->format_news_page_item(
'item' => $single_item,
'base_url' => $base_url,
);
}
return $html;
}
=head2 $news_manager->get_news_page_entries('num_items' => 5, 'base_url' => "news/")
This generates HTML for the news page. 'base_url' points to a URL to be
appended to each item's ID.
=cut
sub get_news_box_contents
{
my $self = shift;
my (%args) = (@_);
my $html = "";
foreach my $item (reverse(@{$self->get_items_to_include(\%args)}))
{
$html .= "get_item_rel_url($item) . "\">" .
CGI::escapeHTML($item->title()) . "\n";
}
return $html;
}
sub get_news_box
{
my $self = shift;
my $html = "";
$html .= qq{\n};
$html .= qq{
News
\n};
$html .= qq{
\n};
$html .=
$self->get_news_box_contents(
@_
);
$html .= qq{- More…
};
$html .= qq{
\n};
$html .= qq{
\n};
return $html;
}
=head2 $news_manager->get_news_box('num_items' => 5)
This generates an HTML news box with the recent headlines.
=cut
1;
__END__
=head1 AUTHOR
Shlomi Fish, C<< >>
=head1 BUGS
Please report any bugs or feature requests to
C, or through the web interface at
L.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
=head1 SEE ALSO
L, L.
=head1 ACKNOWLEDGEMENTS
=head1 COPYRIGHT & LICENSE
Copyright 2005 Shlomi Fish, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the MIT X11 license.
=cut