class Atom10Feed extends XMLStringer
{
public $xw;
+
+ // @fixme most of these should probably be read-only properties
private $namespaces;
private $authors;
private $subject;
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;
$xs->element('name', null, $name);
} else {
throw new Atom10FeedException(
- 'author element must contain a name element.'
+ // TRANS: Atom feed exception thrown when an author element does not contain a name element.
+ _('Author element must contain a name element.')
);
}
}
/**
- * Add a activity feed subject via raw XML string
+ * Deprecated <activity:subject>; ignored
*
* @param string $xmlSubject An XML string representation of the subject
*
* @return void
*/
+
function setActivitySubject($xmlSubject)
{
- $this->subject = $xmlSubject;
+ // TRANS: Server exception thrown when using the method setActivitySubject() in the class Atom10Feed.
+ throw new ServerException(_('Do not use this method!'));
}
function getNamespaces()
}
$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);
$this->renderAuthors();
+ if ($this->selfLink) {
+ $this->addLink($this->selfLink, array('rel' => 'self',
+ 'type' => $this->selfLinkType));
+ }
$this->renderLinks();
}
$this->id = $id;
}
+ function setSelfLink($url, $type='application/atom+xml')
+ {
+ $this->selfLink = $url;
+ $this->selfLinkType = $type;
+ }
+
function setTitle($title)
{
$this->title = $title;
array_push($this->links, $attrs);
}
-
}