Index: Writer/Extension/Atom/Renderer/Feed.php =================================================================== --- Writer/Extension/Atom/Renderer/Feed.php (revision 22555) +++ Writer/Extension/Atom/Renderer/Feed.php (working copy) @@ -50,15 +50,16 @@ */ public function render() { - /** - * RSS 2.0 only. Used mainly to include Atom links and - * Pubsubhubbub Hub endpoint URIs under the Atom namespace - */ if (strtolower($this->getType()) == 'atom') { - return; + $this->_setIcon($this->_dom, $this->_base); + } else { + /** + * RSS 2.0 only. Used mainly to include Atom links and + * Pubsubhubbub Hub endpoint URIs under the Atom namespace + */ + $this->_setFeedLinks($this->_dom, $this->_base); + $this->_setHubs($this->_dom, $this->_base); } - $this->_setFeedLinks($this->_dom, $this->_base); - $this->_setHubs($this->_dom, $this->_base); if ($this->_called) { $this->_appendNamespaces(); } @@ -120,4 +121,25 @@ } $this->_called = true; } + + /** + * Set atom icon + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setIcon(DOMDocument $dom, DOMElement $root) + { + $icon = $this->getDataContainer()->getIcon(); + if (!$icon || empty($icon)) { + return; + } + + $icon = $dom->createElement('icon', $icon); + $root->appendChild($icon); + + $this->_called = true; + } + } Index: Writer/Extension/Atom/Feed.php =================================================================== --- Writer/Extension/Atom/Feed.php (revision 0) +++ Writer/Extension/Atom/Feed.php (revision 0) @@ -0,0 +1,95 @@ +_encoding = $enc; + return $this; + } + + /** + * Get feed encoding + * + * @return string + */ + public function getEncoding() + { + return $this->_encoding; + } + + /** + * Get the icon + * + * @return string|null + */ + public function getIcon() + { + if (!array_key_exists('icon', $this->_data)) { + return null; + } + return $this->_data['icon']; + } + + /** + * Set feed icon + * + * @param string $value + * @return Zend_Feed_Writer_Extension_Icon_Feed + */ + public function setIcon($value) + { + if (!Zend_Uri::check($value)) { + require_once 'Zend/Feed/Exception.php'; + throw new Zend_Feed_Exception('invalid parameter: "icon" may only' + . ' be a valid URI/IRI'); + } + $this->_data['icon'] = $value; + return $this; + } +}