summaryrefslogtreecommitdiff
path: root/lib/atom10feed.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-04 07:00:45 -0800
committerBrion Vibber <brion@pobox.com>2010-03-04 07:00:45 -0800
commit62d5f1addb1b710a387f7732ace1dd33bd1b86c1 (patch)
treedf1d6d402dd057c330b0eb71b803d595c024d476 /lib/atom10feed.php
parent0f1c6e239acbf2c024c3aae9819d891f02b05bfd (diff)
parent9f861e9d895325adbb2dc7f1d540a442be2c1b2f (diff)
Merge branch 'testing'
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;