Added 2 new events: StartApiRss and StartApiAtom

This commit is contained in:
Craig Andrews 2009-08-28 14:42:51 -04:00
parent 53ec4223e4
commit 6e570a8440
2 changed files with 12 additions and 5 deletions

View File

@ -247,3 +247,10 @@ StartLoadDoc: before loading a help doc (hook this to show your own documentatio
EndLoadDoc: after loading a help doc (hook this to modify other documentation) EndLoadDoc: after loading a help doc (hook this to modify other documentation)
- $title: title of the document - $title: title of the document
- $output: HTML output to show - $output: HTML output to show
StartApiRss: after the rss <channel> element is started
- $action: action object being shown
StartApiAtom: after the <feed> element is started
- $action: action object being shown

View File

@ -595,7 +595,6 @@ class TwitterapiAction extends Action
$this->init_document('rss'); $this->init_document('rss');
$this->elementStart('channel');
$this->element('title', null, $title); $this->element('title', null, $title);
$this->element('link', null, $link); $this->element('link', null, $link);
if (!is_null($suplink)) { if (!is_null($suplink)) {
@ -621,7 +620,6 @@ class TwitterapiAction extends Action
} }
} }
$this->elementEnd('channel');
$this->end_twitter_rss(); $this->end_twitter_rss();
} }
@ -668,7 +666,6 @@ class TwitterapiAction extends Action
$this->init_document('rss'); $this->init_document('rss');
$this->elementStart('channel');
$this->element('title', null, $title); $this->element('title', null, $title);
$this->element('link', null, $link); $this->element('link', null, $link);
$this->element('description', null, $subtitle); $this->element('description', null, $subtitle);
@ -687,7 +684,6 @@ class TwitterapiAction extends Action
} }
} }
$this->elementEnd('channel');
$this->end_twitter_rss(); $this->end_twitter_rss();
} }
@ -944,11 +940,14 @@ class TwitterapiAction extends Action
function init_twitter_rss() function init_twitter_rss()
{ {
$this->startXML(); $this->startXML();
$this->elementStart('rss', array('version' => '2.0')); $this->elementStart('rss', array('version' => '2.0', 'xmlns:atom'=>'http://www.w3.org/2005/Atom'));
$this->elementStart('channel');
Event::handle('StartApiRss', array($this));
} }
function end_twitter_rss() function end_twitter_rss()
{ {
$this->elementEnd('channel');
$this->elementEnd('rss'); $this->elementEnd('rss');
$this->endXML(); $this->endXML();
} }
@ -960,6 +959,7 @@ class TwitterapiAction extends Action
$this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom', $this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom',
'xml:lang' => 'en-US', 'xml:lang' => 'en-US',
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0')); 'xmlns:thr' => 'http://purl.org/syndication/thread/1.0'));
Event::handle('StartApiAtom', array($this));
} }
function end_twitter_atom() function end_twitter_atom()