' . "\n";
$xml .= ' ' . trim($this->quote($this->title)) . '' . "\n";
if (is_array($this->links)) foreach ($this->links as $link)
{
$rel = '';
if ($link['rel'])
$rel = ' rel="' . trim($this->quote($link['rel'], true)) . '"';
$type = '';
if ($link['type'])
$type = ' type="' . trim($this->quote($link['type'], true)) . '"';
$title = '';
if ($link['title'])
$title = ' title="' . trim($this->quote($link['title'], true)) . '"';
$xml .= ' ' . "\n";
}
if ($this->author)
{
$xml .= ' ' . "\n";
if (is_array($this->author))
{
$xml .= ' ' . trim($this->quote($this->author['name'])) . '' . "\n";
if ($this->author['email'])
$xml .= ' ' . trim($this->quote($this->author['email'])) . '' . "\n";
if ($this->author['uri'])
$xml .= ' ' . trim($this->quote($this->author['uri'])) . '' . "\n";
}
else
$xml .= ' ' . trim($this->quote($this->author)) . '' . "\n";
$xml .= ' ' . "\n";
}
// TODO:
if ($this->published)
{
$published = $this->published;
if (is_int($published)) $published = gmdate('Y-m-d\TH:i:s\Z', $published);
$xml .= ' ' . trim($this->quote($published)) . '' . "\n";
}
$updated = $this->updated;
if (is_int($updated)) $updated = gmdate('Y-m-d\TH:i:s\Z', $updated);
$xml .= ' ' . trim($this->quote($updated)) . '' . "\n";
$xml .= ' ' . trim($this->quote($this->id)) . '' . "\n";
if ($this->summary)
$xml .= ' ' . trim($this->quote($this->summary)) . '' . "\n";
if ($this->content)
{
$content = '';
if ($this->content['type'] == 'html')
$content = trim($this->quote($this->content['data']));
elseif ($this->content['type'] == 'xhtml')
$content = '' . trim($this->content['data']) . '
';
else
{
$content = trim($this->quote($this->content['data']));
$this->content['type'] = 'text';
}
$type = '';
if ($this->content['type'])
$type = ' type="' . trim($this->quote($this->content['type'], true)) . '"';
$lang = '';
if ($this->content['lang'])
$lang = ' xml:lang="' . trim($this->quote($this->content['lang'], true)) . '"';
$base = '';
if ($this->content['base'])
$base = ' xml:base="' . trim($this->quote($this->content['base'], true)) . '"';
$xml .= ' ' . $content . '' . "\n";
}
$xml .= ' ' . "\n";
return $xml;
}
}
?>