web/lib/Zend/Feed/Reader/Extension/Atom/Feed.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    12  * obtain it through the world-wide-web, please send an email
    12  * obtain it through the world-wide-web, please send an email
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Feed_Reader
    16  * @package    Zend_Feed_Reader
    17  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @version    $Id: Feed.php 23170 2010-10-19 18:29:24Z mabe $
    19  * @version    $Id: Feed.php 24593 2012-01-05 20:35:02Z matthew $
    20  */
    20  */
    21 
    21 
    22 /**
    22 /**
    23  * @see Zend_Feed_Reader_Extension_FeedAbstract
    23  * @see Zend_Feed_Reader_Extension_FeedAbstract
    24  */
    24  */
    40 require_once 'Zend/Feed/Reader/Collection/Author.php';
    40 require_once 'Zend/Feed/Reader/Collection/Author.php';
    41 
    41 
    42 /**
    42 /**
    43  * @category   Zend
    43  * @category   Zend
    44  * @package    Zend_Feed_Reader
    44  * @package    Zend_Feed_Reader
    45  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    45  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    46  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    46  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    47  */
    47  */
    48 class Zend_Feed_Reader_Extension_Atom_Feed
    48 class Zend_Feed_Reader_Extension_Atom_Feed
    49     extends Zend_Feed_Reader_Extension_FeedAbstract
    49     extends Zend_Feed_Reader_Extension_FeedAbstract
    50 {
    50 {
   313 
   313 
   314         $this->_data['image'] = $image;
   314         $this->_data['image'] = $image;
   315 
   315 
   316         return $this->_data['image'];
   316         return $this->_data['image'];
   317     }
   317     }
   318     
   318 
   319     /**
   319     /**
   320      * Get the feed image
   320      * Get the feed image
   321      *
   321      *
   322      * @return array|null
   322      * @return array|null
   323      */
   323      */
   418     {
   418     {
   419         if (array_key_exists('hubs', $this->_data)) {
   419         if (array_key_exists('hubs', $this->_data)) {
   420             return $this->_data['hubs'];
   420             return $this->_data['hubs'];
   421         }
   421         }
   422         $hubs = array();
   422         $hubs = array();
   423         
   423 
   424         $list = $this->_xpath->query($this->getXpathPrefix()
   424         $list = $this->_xpath->query($this->getXpathPrefix()
   425             . '//atom:link[@rel="hub"]/@href');
   425             . '//atom:link[@rel="hub"]/@href');
   426 
   426 
   427         if ($list->length) {
   427         if ($list->length) {
   428             foreach ($list as $uri) {
   428             foreach ($list as $uri) {
   456 
   456 
   457         $this->_data['title'] = $title;
   457         $this->_data['title'] = $title;
   458 
   458 
   459         return $this->_data['title'];
   459         return $this->_data['title'];
   460     }
   460     }
   461     
   461 
   462     /**
   462     /**
   463      * Get all categories
   463      * Get all categories
   464      *
   464      *
   465      * @return Zend_Feed_Reader_Collection_Category
   465      * @return Zend_Feed_Reader_Collection_Category
   466      */
   466      */
   511         $author = array();
   511         $author = array();
   512 
   512 
   513         $emailNode = $element->getElementsByTagName('email');
   513         $emailNode = $element->getElementsByTagName('email');
   514         $nameNode  = $element->getElementsByTagName('name');
   514         $nameNode  = $element->getElementsByTagName('name');
   515         $uriNode   = $element->getElementsByTagName('uri');
   515         $uriNode   = $element->getElementsByTagName('uri');
   516         
   516 
   517         if ($emailNode->length && strlen($emailNode->item(0)->nodeValue) > 0) {
   517         if ($emailNode->length && strlen($emailNode->item(0)->nodeValue) > 0) {
   518             $author['email'] = $emailNode->item(0)->nodeValue;
   518             $author['email'] = $emailNode->item(0)->nodeValue;
   519         }
   519         }
   520 
   520 
   521         if ($nameNode->length && strlen($nameNode->item(0)->nodeValue) > 0) {
   521         if ($nameNode->length && strlen($nameNode->item(0)->nodeValue) > 0) {