From: Michael J. Rubinsky Date: Mon, 28 Jun 2010 23:28:43 +0000 (-0400) Subject: Exceptions, Horde_Url, some other H4 changes. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2890f044e2c683ba01a6e3232725059d4cec74d7;p=horde.git Exceptions, Horde_Url, some other H4 changes. --- diff --git a/jonah/lib/Block/delivery.php b/jonah/lib/Block/delivery.php index adb905e2a..e79bf428c 100644 --- a/jonah/lib/Block/delivery.php +++ b/jonah/lib/Block/delivery.php @@ -14,8 +14,8 @@ $block_name = _("Feeds"); * @author Roel Gloudemans * @package Horde_Block */ -class Horde_Block_Jonah_delivery extends Horde_Block { - +class Horde_Block_Jonah_delivery extends Horde_Block +{ var $_app = 'jonah'; function _title() @@ -25,11 +25,9 @@ class Horde_Block_Jonah_delivery extends Horde_Block { function _content() { - $news = Jonah_News::factory(); - - $channels = array(); - $channels = $news->getChannels(Jonah::INTERNAL_CHANNEL); - if (is_a($channels, 'PEAR_Error')) { + try { + $channels = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannels(); + } catch (Jonah_Exception $e) { $channels = array(); } @@ -37,22 +35,20 @@ class Horde_Block_Jonah_delivery extends Horde_Block { foreach ($channels as $key => $channel) { /* Link for HTML delivery. */ - $url = Horde::applicationUrl('delivery/html.php'); - $url = Horde_Util::addParameter($url, 'channel_id', $channel['channel_id']); + $url = Horde::applicationUrl('delivery/html.php')->add('channel_id', $channel['channel_id']); $label = sprintf(_("\"%s\" stories in HTML"), $channel['channel_name']); $html .= '' . Horde::img('story_marker.png') . ' ' . - Horde::link($url, $label, '', '', '', $label) . + $url->link(array('title' => $label)) . htmlspecialchars($channel['channel_name']) . ''; $html .= '' . ($channel['channel_updated'] ? date('M d, Y H:i', (int)$channel['channel_updated']) : '-') . ''; /* Link for feed delivery. */ - $url = Horde::applicationUrl('delivery/rss.php', true, -1); - $url = Horde_Util::addParameter($url, 'channel_id', $channel['channel_id']); + $url = Horde::applicationUrl('delivery/rss.php', true, -1)->add('channel_id', $channel['channel_id']); $label = sprintf(_("RSS Feed of \"%s\""), $channel['channel_name']); $html .= '' . - Horde::link($url, $label) . + $url->link(array('title' => $label)) . Horde::img('feed.png') . ' '; }