diff options
Diffstat (limited to 'libs/Zend/Feed/Reader/Extension/DublinCore/Entry.php')
-rw-r--r-- | libs/Zend/Feed/Reader/Extension/DublinCore/Entry.php | 66 |
1 files changed, 16 insertions, 50 deletions
diff --git a/libs/Zend/Feed/Reader/Extension/DublinCore/Entry.php b/libs/Zend/Feed/Reader/Extension/DublinCore/Entry.php index 4ad104b6ff..522e2c1498 100644 --- a/libs/Zend/Feed/Reader/Extension/DublinCore/Entry.php +++ b/libs/Zend/Feed/Reader/Extension/DublinCore/Entry.php @@ -14,33 +14,33 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Entry.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Entry.php 16711 2009-07-14 16:10:54Z matthew $ */ /** * @see Zend_Feed_Reader */ -// require_once 'Zend/Feed/Reader.php'; +require_once 'Zend/Feed/Reader.php'; /** * @see Zend_Feed_Reader_Extension_EntryAbstract */ -// require_once 'Zend/Feed/Reader/Extension/EntryAbstract.php'; +require_once 'Zend/Feed/Reader/Extension/EntryAbstract.php'; /** * @see Zend_Date */ -// require_once 'Zend/Date.php'; +require_once 'Zend/Date.php'; /** * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Reader_Extension_DublinCore_Entry +class Zend_Feed_Reader_Extension_DublinCore_Entry extends Zend_Feed_Reader_Extension_EntryAbstract { /** @@ -87,56 +87,22 @@ class Zend_Feed_Reader_Extension_DublinCore_Entry if ($list->length) { foreach ($list as $author) { - $authors[] = array( - 'name' => $author->nodeValue - ); + if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_20 + && preg_match("/\(([^\)]+)\)/", $author->nodeValue, $matches, PREG_OFFSET_CAPTURE) + ) { + $authors[] = $matches[1][0]; + } else { + $authors[] = $author->nodeValue; + } } - $authors = new Zend_Feed_Reader_Collection_Author( - Zend_Feed_Reader::arrayUnique($authors) - ); - } else { - $authors = null; + + $authors = array_unique($authors); } $this->_data['authors'] = $authors; return $this->_data['authors']; } - - /** - * Get categories (subjects under DC) - * - * @return Zend_Feed_Reader_Collection_Category - */ - public function getCategories() - { - if (array_key_exists('categories', $this->_data)) { - return $this->_data['categories']; - } - - $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:subject'); - - if (!$list->length) { - $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:subject'); - } - - if ($list->length) { - $categoryCollection = new Zend_Feed_Reader_Collection_Category; - foreach ($list as $category) { - $categoryCollection[] = array( - 'term' => $category->nodeValue, - 'scheme' => null, - 'label' => $category->nodeValue, - ); - } - } else { - $categoryCollection = new Zend_Feed_Reader_Collection_Category; - } - - $this->_data['categories'] = $categoryCollection; - return $this->_data['categories']; - } - /** * Get the entry content |