return null;
}
- function asString($namespace=false, $author=true)
+ function asString($namespace=false, $author=true, $source=false)
{
$xs = new XMLStringer(true);
if ($this->verb == ActivityVerb::POST && count($this->objects) == 1) {
- common_debug('Using default object entry notation.');
-
$obj = $this->objects[0];
$xs->element('id', null, $obj->id);
foreach ($this->enclosures as $enclosure) {
if (is_string($enclosure)) {
- $xs->element('link', array('href' => $enclosure));
+ $xs->element('link', array('rel' => 'enclosure',
+ 'href' => $enclosure));
} else {
$attributes = array('rel' => 'enclosure',
'href' => $enclosure->url,
if ($enclosure->title) {
$attributes['title'] = $enclosure->title;
}
- $xs->element('link', array('href' => $enclosure));
+ $xs->element('link', $attributes);
}
}
// Info on the source feed
- if (!empty($this->source)) {
+ if ($source && !empty($this->source)) {
$xs->elementStart('source');
$xs->element('id', null, $this->source->id);
$xs->elementEnd('entry');
- return $xs->getString();
+ $str = $xs->getString();
+
+ return $str;
}
private function _child($element, $tag, $namespace=self::SPEC)