1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
12: class Jonah_Block_Delivery extends Horde_Core_Block
13: {
14: 15:
16: public function __construct($app, $params = array())
17: {
18: parent::__construct($app, $params);
19:
20: $this->_name = _("Feeds");
21: }
22:
23: 24:
25: protected function _content()
26: {
27: try {
28: $channels = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannels();
29: } catch (Jonah_Exception $e) {
30: $channels = array();
31: }
32:
33: $html = '';
34:
35: foreach ($channels as $key => $channel) {
36:
37: $url = Horde::url('delivery/html.php')->add('channel_id', $channel['channel_id']);
38: $label = sprintf(_("\"%s\" stories in HTML"), $channel['channel_name']);
39: $html .= '<tr><td width="140">' .
40: Horde::img('story_marker.png') . ' ' .
41: $url->link(array('title' => $label)) .
42: htmlspecialchars($channel['channel_name']) . '</a></td>';
43:
44: $html .= '<td>' . ($channel['channel_updated'] ? date('M d, Y H:i', (int)$channel['channel_updated']) : '-') . '</td>';
45:
46:
47: $url = Horde::url('delivery/rss.php', true, -1)->add('channel_id', $channel['channel_id']);
48: $label = sprintf(_("RSS Feed of \"%s\""), $channel['channel_name']);
49: $html .= '<td align="right" class="nowrap">' .
50: $url->link(array('title' => $label)) .
51: Horde::img('feed.png') . '</a> ';
52: }
53:
54: if ($html) {
55: return '<table cellspacing="0" width="100%" class="linedRow striped">' . $html . '</table>';
56: } else {
57: return '<p><em>' . _("No feeds are available.") . '</em></p>';
58: }
59: }
60:
61: }
62: