1: <?php
2: /**
3: * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
4: *
5: * @author Chuck Hagenbuch <chuck@horde.org>
6: * @license http://www.horde.org/licenses/bsd BSD
7: * @category Horde
8: * @package Feed
9: */
10:
11: /**
12: * Blogroll feed list class
13: *
14: * This is not a generic OPML implementation, but one focused on lists of feeds,
15: * i.e. blogrolls. See http://en.wikipedia.org/wiki/OPML for more information on
16: * OPML.
17: *
18: * @author Chuck Hagenbuch <chuck@horde.org>
19: * @license http://www.horde.org/licenses/bsd BSD
20: * @category Horde
21: * @package Feed
22: */
23: class Horde_Feed_Blogroll extends Horde_Feed_Base
24: {
25: /**
26: * The classname for individual feed elements.
27: * @var string
28: */
29: protected $_listItemClassName = 'Horde_Feed_Entry_Blogroll';
30:
31: /**
32: * The default namespace for blogrolls.
33: * @var string
34: */
35: protected $_defaultNamespace = '';
36:
37: /**
38: * The XML string for an "empty" Blogroll.
39: * @var string
40: */
41: protected $_emptyXml = '<?xml version="1.0" encoding="utf-8"?><opml version="1.1"></opml>';
42:
43: /**
44: * Cache outline elements so they don't need to be searched for on every
45: * operation.
46: */
47: protected function _buildListItemCache()
48: {
49: $entries = array();
50: foreach ($this->_element->getElementsByTagName('outline') as $child) {
51: if ($child->attributes->getNamedItem('xmlurl')) {
52: $entries[] = $child;
53: }
54: }
55:
56: return $entries;
57: }
58:
59: public function getBody()
60: {
61: return $this;
62: }
63:
64: public function getOutline()
65: {
66: return $this;
67: }
68:
69: public function getTitle()
70: {
71: return $this->head->title;
72: }
73:
74: }
75: