summaryrefslogtreecommitdiff
path: root/lib/atom10feed.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-04 06:07:28 -0800
committerBrion Vibber <brion@pobox.com>2010-03-04 06:07:28 -0800
commitb218aee94e581230e1efa14d4ae1a19756986ddf (patch)
treea832ddf3b4322b520fd20c4d8ea2d31720c3679b /lib/atom10feed.php
parent358556057a87c0cb9291223a2026782e6548ff2e (diff)
parent14d7f4a598d0e24467fe3eafd9a02b0e651edad8 (diff)
Merge commit 'origin/testing' into 0.9.x
Conflicts: lib/action.php lib/adminpanelaction.php
Diffstat (limited to 'lib/atom10feed.php')
-rw-r--r--lib/atom10feed.php28
1 files changed, 25 insertions, 3 deletions
diff --git a/lib/atom10feed.php b/lib/atom10feed.php
index 8842840d5..2d342e785 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;
@@ -172,6 +176,14 @@ class Atom10Feed extends XMLStringer
}
$this->elementStart('feed', $commonAttrs);
+ $this->element(
+ 'generator', array(
+ 'url' => '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;