ENHANCEMENT Addition of Date, so date can be used in the RSS feed

ENHANCEMENT Allow casting of Date and Title so can be modified in template
This commit is contained in:
Sean Harvey 2008-12-10 00:58:17 +00:00
parent 01b48e74b7
commit dcb23d6cc3

View File

@ -51,9 +51,19 @@ class RSSWidget extends Widget {
$this->feed->init(); $this->feed->init();
if($items = $this->feed->get_items(0, $this->NumberToShow)) { if($items = $this->feed->get_items(0, $this->NumberToShow)) {
foreach($items as $item) { foreach($items as $item) {
// Cast the Date
$date = new Date('Date');
$date->setValue($item->get_date());
// Cast the Title
$title = new Text('Title');
$title->setValue($item->get_title());
$output->push(new ArrayData(array( $output->push(new ArrayData(array(
"Title" => $item->get_title(), 'Title' => $title,
"Link" => $item->get_link() 'Date' => $date,
'Link' => $item->get_link()
))); )));
} }
return $output; return $output;