X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fatom10feed.php;h=3ae9dc81be077c3b387202ffdb49800cc565245e;hb=56e72ec7a138b823b8094312d935c9644838a8eb;hp=8842840d568ef862d387ecac72b9c8cfcbf2553b;hpb=13ad48fab3b64e9c8376761b55caa1e19a49934b;p=quix0rs-gnu-social.git diff --git a/lib/atom10feed.php b/lib/atom10feed.php index 8842840d56..3ae9dc81be 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; @@ -105,7 +109,7 @@ class Atom10Feed extends XMLStringer $xs->element('name', null, $name); } else { throw new Atom10FeedException( - 'author element must contain a name element.' + _('author element must contain a name element.') ); } @@ -172,6 +176,14 @@ class Atom10Feed extends XMLStringer } $this->elementStart('feed', $commonAttrs); + $this->element( + 'generator', array( + 'uri' => 'http://status.net', + 'version' => STATUSNET_VERSION + ), + 'StatusNet' + ); + $this->element('id', null, $this->id); $this->element('title', null, $this->title); $this->element('subtitle', null, $this->subtitle); @@ -184,6 +196,10 @@ class Atom10Feed extends XMLStringer $this->renderAuthors(); + if ($this->selfLink) { + $this->addLink($this->selfLink, array('rel' => 'self', + 'type' => $this->selfLinkType)); + } $this->renderLinks(); } @@ -253,6 +269,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; @@ -301,5 +323,4 @@ class Atom10Feed extends XMLStringer array_push($this->links, $attrs); } - }