diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-03 12:51:23 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-03 16:33:20 -0800 |
commit | 9fadf8da1164d620284917b829329e195aa2a226 (patch) | |
tree | ff642f7abca80ee2e9b1d6ba1c97c20b250a88bd /lib/atom10feed.php | |
parent | 04e474c98c9b907fe2d0f263fad79018a15c0783 (diff) |
Put all required field setup into AtomUserNoticeFeed and AtomGroupNoticeFeed, consolidating some code. (RSS feeds pulling title, logo etc from the Atom data structure so we don't dupe it.)
OStatus now calling the feed classes directly instead of faking a call into the API, should be less flakey.
Diffstat (limited to 'lib/atom10feed.php')
-rw-r--r-- | lib/atom10feed.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/atom10feed.php b/lib/atom10feed.php index 8842840d5..c1fdeaae9 100644 --- a/lib/atom10feed.php +++ b/lib/atom10feed.php @@ -49,6 +49,8 @@ class Atom10FeedException extends Exception class Atom10Feed extends XMLStringer { public $xw; + + // @fixme most of these should probably be read-only properties private $namespaces; private $authors; private $subject; @@ -57,10 +59,12 @@ class Atom10Feed extends XMLStringer private $generator; private $icon; private $links; - private $logo; + private $selfLink; + private $selfLinkType; + public $logo; private $rights; - private $subtitle; - private $title; + public $subtitle; + public $title; private $published; private $updated; private $entries; @@ -184,6 +188,10 @@ class Atom10Feed extends XMLStringer $this->renderAuthors(); + if ($this->selfLink) { + $this->addLink($this->selfLink, array('rel' => 'self', + 'type' => $this->selfLinkType)); + } $this->renderLinks(); } @@ -253,6 +261,12 @@ class Atom10Feed extends XMLStringer $this->id = $id; } + function setSelfLink($url, $type='application/atom+xml') + { + $this->selfLink = $url; + $this->selfLinkType = $type; + } + function setTitle($title) { $this->title = $title; |