From fdd301e35c451c87ffa559d67cb69b92d30c0e63 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 12 Feb 2010 11:33:16 +0100 Subject: [PATCH] We don't need a custom notification handler for Kronolith anymore. --- framework/Core/lib/Horde/Registry.php | 3 ++- kronolith/lib/Ajax/Application.php | 2 +- kronolith/lib/Application.php | 3 --- kronolith/lib/Notification/Listener/Status.php | 30 -------------------------- 4 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 kronolith/lib/Notification/Listener/Status.php diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 0160213c5..f723cf0b1 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -317,8 +317,9 @@ class Horde_Registry /* Initialize notification object. Always attach status listener by * default. */ $GLOBALS['notification'] = Horde_Notification::singleton(); - $GLOBALS['notification']->attach('status'); + $statusListener = $GLOBALS['notification']->attach('status'); $injector->setInstance('Horde_Notification', $GLOBALS['notification']); + $injector->setInstance('Horde_Notification_Listener', $statusListener); } /** diff --git a/kronolith/lib/Ajax/Application.php b/kronolith/lib/Ajax/Application.php index e17c1ee67..616f4c53c 100644 --- a/kronolith/lib/Ajax/Application.php +++ b/kronolith/lib/Ajax/Application.php @@ -22,7 +22,7 @@ class Kronolith_Ajax_Application extends Horde_Ajax_Application_Base */ public function notificationHandler() { - return $GLOBALS['kronolith_notify']; + return $GLOBALS['injector']->getInstance('Horde_Notification_Listener'); } /** diff --git a/kronolith/lib/Application.php b/kronolith/lib/Application.php index 89690fe07..ba4effc85 100644 --- a/kronolith/lib/Application.php +++ b/kronolith/lib/Application.php @@ -45,7 +45,6 @@ class Kronolith_Application extends Horde_Registry_Application * Initialization function. * * Global variables defined: - * $kronolith_notify - A Horde_Notification_Listener object. * $kronolith_shares - TODO */ protected function _init() @@ -65,8 +64,6 @@ class Kronolith_Application extends Horde_Registry_Application $GLOBALS['kronolith_shares'] = Horde_Share::singleton($GLOBALS['registry']->getApp()); Kronolith::initialize(); - - $GLOBALS['kronolith_notify'] = $GLOBALS['notification']->replace('status', array(), 'Kronolith_Notification_Listener_Status'); } /** diff --git a/kronolith/lib/Notification/Listener/Status.php b/kronolith/lib/Notification/Listener/Status.php deleted file mode 100644 index c6a3df988..000000000 --- a/kronolith/lib/Notification/Listener/Status.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @package Horde_Notification - */ -class Kronolith_Notification_Listener_Status extends Horde_Notification_Listener_Status -{ - /** - * Handle every message of type dimp.*; otherwise delegate back to - * the parent. - * - * @param string $type The message type in question. - * - * @return boolean Whether this listener handles the type. - */ - public function handles($type) - { - return (substr($type, 0, 10) == 'kronolith.') || parent::handles($type); - } - -} -- 2.11.0