We don't need a custom notification handler for Kronolith anymore.
authorJan Schneider <jan@horde.org>
Fri, 12 Feb 2010 10:33:16 +0000 (11:33 +0100)
committerJan Schneider <jan@horde.org>
Fri, 12 Feb 2010 10:33:16 +0000 (11:33 +0100)
framework/Core/lib/Horde/Registry.php
kronolith/lib/Ajax/Application.php
kronolith/lib/Application.php
kronolith/lib/Notification/Listener/Status.php [deleted file]

index 0160213..f723cf0 100644 (file)
@@ -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);
     }
 
     /**
index e17c1ee..616f4c5 100644 (file)
@@ -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');
     }
 
     /**
index 89690fe..ba4effc 100644 (file)
@@ -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 (file)
index c6a3df9..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-/**
- * The Kronolith_Notification_Listener_Status:: class extends the
- * Horde_Notification_Listener_Status:: class to return all kronolith messages
- * instead of printing them.
- *
- * Copyright 2005-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author  Jan Schneider <jan@horde.org>
- * @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);
-    }
-
-}