From 19dfab4fe9bbcddaca56cecdf9790b1624bde7df Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 24 Jun 2009 17:38:49 -0600 Subject: [PATCH] Notification:: -> Horde_Notification:: --- babel/lib/base.php | 4 ++-- chora/lib/base.php | 2 +- crumb/lib/base.php | 2 +- fima/lib/base.php | 2 +- folks/lib/base.php | 2 +- .../Listener/{status-dimp.php => StatusDimp.php} | 27 ++++++++-------------- .../Listener/{status.php => StatusImp.php} | 17 ++++++-------- imp/lib/base.php | 14 ++++------- ingo/lib/base.php | 2 +- jeta/lib/base.php | 2 +- kastalia/lib/base.php | 2 +- koward/lib/Koward.php | 3 +-- .../Listener/{status.php => Status.php} | 27 ++++++++-------------- kronolith/lib/base.php | 5 ++-- news/lib/base.php | 2 +- skoli/lib/base.php | 2 +- 16 files changed, 46 insertions(+), 69 deletions(-) rename imp/lib/Notification/Listener/{status-dimp.php => StatusDimp.php} (75%) rename imp/lib/Notification/Listener/{status.php => StatusImp.php} (75%) rename kronolith/lib/Notification/Listener/{status.php => Status.php} (76%) diff --git a/babel/lib/base.php b/babel/lib/base.php index 5b79ebe5d..eb1627fb6 100644 --- a/babel/lib/base.php +++ b/babel/lib/base.php @@ -23,7 +23,7 @@ if (!defined('BABEL_BASE')) { require_once HORDE_BASE . '/lib/core.php'; /* Notification system. */ -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); $notification->attach('status'); /* Registry. */ @@ -31,7 +31,7 @@ $registry = &Registry::singleton(); if (is_a(($pushed = $registry->pushApp('babel', !defined('AUTH_HANDLER'))), 'PEAR_Error')) { if ($pushed->getCode() == 'permission_denied') { - Horde::authenticationFailureRedirect(); + Horde::authenticationFailureRedirect(); } Horde::fatal($pushed, __FILE__, __LINE__, false); } diff --git a/chora/lib/base.php b/chora/lib/base.php index cc712adb8..458c51ae8 100644 --- a/chora/lib/base.php +++ b/chora/lib/base.php @@ -41,7 +41,7 @@ $conf = &$GLOBALS['conf']; define('CHORA_TEMPLATES', $registry->get('templates')); // Notification system. -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); $notification->attach('status'); // Chora base library. diff --git a/crumb/lib/base.php b/crumb/lib/base.php index c75ffab39..33fb283aa 100644 --- a/crumb/lib/base.php +++ b/crumb/lib/base.php @@ -34,7 +34,7 @@ $conf = &$GLOBALS['conf']; @define('CRUMB_TEMPLATES', $registry->get('templates')); // Notification system. -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); $notification->attach('status'); // Define the base file path of Crumb. diff --git a/fima/lib/base.php b/fima/lib/base.php index c0dc84c44..1c4906a44 100644 --- a/fima/lib/base.php +++ b/fima/lib/base.php @@ -42,7 +42,7 @@ if (!defined('FIMA_BASE')) { } // Notification system. -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); $notification->attach('status'); // Fima base library diff --git a/folks/lib/base.php b/folks/lib/base.php index dd4e00554..5267aacf1 100644 --- a/folks/lib/base.php +++ b/folks/lib/base.php @@ -29,7 +29,7 @@ $conf = &$GLOBALS['conf']; define('FOLKS_TEMPLATES', $registry->get('templates')); // Notification system. -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); $notification->attach('status'); // Define the base file path of Folks. diff --git a/imp/lib/Notification/Listener/status-dimp.php b/imp/lib/Notification/Listener/StatusDimp.php similarity index 75% rename from imp/lib/Notification/Listener/status-dimp.php rename to imp/lib/Notification/Listener/StatusDimp.php index 0bf46dcf7..fc578827c 100644 --- a/imp/lib/Notification/Listener/status-dimp.php +++ b/imp/lib/Notification/Listener/StatusDimp.php @@ -1,12 +1,8 @@ * @package Horde_Notification */ -class Notification_Listener_status_dimp extends Notification_Listener_status_imp { - +class IMP_Notification_Listener_StatusDimp extends IMP_Notification_Listener_StatusImp +{ /** * The notified message stack. * * @var array */ - var $_messageStack = array(); + protected $_messageStack = array(); /** * Returns all status message if there are any on the 'status' message @@ -32,7 +28,7 @@ class Notification_Listener_status_dimp extends Notification_Listener_status_imp * @param array &$messageStack The stack of messages. * @param array $options An array of options. */ - function notify(&$messageStack, $options = array()) + public function notify(&$messageStack, $options = array()) { while ($message = array_shift($messageStack)) { $event = @unserialize($message['event']); @@ -52,12 +48,9 @@ class Notification_Listener_status_dimp extends Notification_Listener_status_imp * * @return boolean Whether this listener handles the type. */ - function handles($type) + public function handles($type) { - if (substr($type, 0, 5) == 'dimp.') { - return true; - } - return parent::handles($type); + return (substr($type, 0, 5) == 'dimp.') || parent::handles($type); } /** @@ -68,7 +61,7 @@ class Notification_Listener_status_dimp extends Notification_Listener_status_imp * * @return array List of message hashes. */ - function getStack($encode = false) + public function getStack($encode = false) { $msgs = $this->_messageStack; if (!$encode) { diff --git a/imp/lib/Notification/Listener/status.php b/imp/lib/Notification/Listener/StatusImp.php similarity index 75% rename from imp/lib/Notification/Listener/status.php rename to imp/lib/Notification/Listener/StatusImp.php index 83f9025e5..052d595e1 100644 --- a/imp/lib/Notification/Listener/status.php +++ b/imp/lib/Notification/Listener/StatusImp.php @@ -1,23 +1,20 @@ * @package Horde_Notification */ -class Notification_Listener_status_imp extends Notification_Listener_status { - +class IMP_Notification_Listener_StatusImp extends Horde_Notification_Listener_Status +{ /** - * Constructor + * Constructor. */ - function Notification_Listener_status_imp() + public function __construct() { - parent::Notification_Listener_status(); + parent::__construct(); $this->_handles['imp.reply'] = true; $this->_handles['imp.forward'] = true; $this->_handles['imp.redirect'] = true; @@ -29,7 +26,7 @@ class Notification_Listener_status_imp extends Notification_Listener_status { * * @param array $message One message hash from the stack. */ - function getMessage($message) + public function getMessage($message) { $event = $this->getEvent($message); switch ($message['type']) { diff --git a/imp/lib/base.php b/imp/lib/base.php index ac925d658..aaadec71e 100644 --- a/imp/lib/base.php +++ b/imp/lib/base.php @@ -19,7 +19,7 @@ * Global variables defined: * $imp_imap - An IMP_Imap object * $imp_mbox - Current mailbox information - * $imp_notify - A Notification_Listener_Mobile object + * $imp_notify - A Horde_Notification_Listener object * $imp_search - An IMP_Search object * $mimp_render - (MIMP view only) A Horde_Mobile object * @@ -161,18 +161,14 @@ if (($viewmode == 'dimp') && Horde_Util::nonInputVar('dimp_logout')) { } // Notification system. -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); if (($viewmode == 'mimp') || (Horde_Util::nonInputVar('login_page') && $GLOBALS['browser']->isMobile())) { - require_once 'Horde/Notification/Listener/mobile.php'; - $GLOBALS['imp_notify'] = &$notification->attach('status', null, 'Notification_Listener_mobile'); + $GLOBALS['imp_notify'] = &$notification->attach('status', null, 'Horde_Notification_Listener_Mobile'); } elseif ($viewmode == 'dimp') { - require_once IMP_BASE . '/lib/Notification/Listener/status-dimp.php'; - $GLOBALS['imp_notify'] = &$notification->attach('status', null, 'Notification_Listener_status_dimp'); + $GLOBALS['imp_notify'] = &$notification->attach('status', null, 'IMP_Notification_Listener_DimpStatus'); } else { - require_once IMP_BASE . '/lib/Notification/Listener/status.php'; - require_once 'Horde/Notification/Listener/audio.php'; - $GLOBALS['imp_notify'] = &$notification->attach('status', null, 'Notification_Listener_status_imp'); + $GLOBALS['imp_notify'] = &$notification->attach('status', null, 'IMP_Notification_Listener_ImpStatus'); $notification->attach('audio'); } diff --git a/ingo/lib/base.php b/ingo/lib/base.php index b9b45dfd3..b2d9d629c 100644 --- a/ingo/lib/base.php +++ b/ingo/lib/base.php @@ -33,7 +33,7 @@ if (!defined('INGO_TEMPLATES')) { } // Notification system. -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); $notification->attach('status'); // Redirect the user to the Horde login page if they haven't authenticated. diff --git a/jeta/lib/base.php b/jeta/lib/base.php index 93858d948..61976533a 100644 --- a/jeta/lib/base.php +++ b/jeta/lib/base.php @@ -38,7 +38,7 @@ $conf = &$GLOBALS['conf']; define('JETA_TEMPLATES', $registry->get('templates')); // Notification system. -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); $notification->attach('status'); // Includes. diff --git a/kastalia/lib/base.php b/kastalia/lib/base.php index bbf2e9e4c..7eeb5008e 100755 --- a/kastalia/lib/base.php +++ b/kastalia/lib/base.php @@ -31,7 +31,7 @@ $conf = &$GLOBALS['conf']; @define('KASTALIA_TEMPLATES', $registry->get('templates')); // Notification system. -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); $notification->attach('status'); // Define the base file path of Kastalia. diff --git a/koward/lib/Koward.php b/koward/lib/Koward.php index 7c325ea2c..c6bafc61c 100644 --- a/koward/lib/Koward.php +++ b/koward/lib/Koward.php @@ -56,10 +56,9 @@ class Koward { include_once 'Horde/NLS.php'; include_once 'Horde/Auth.php'; include_once 'Horde/Perms.php'; - include_once 'Horde/Notification.php'; include_once 'Horde/Registry.php'; - $notification = Notification::singleton(); + $notification = &Horde_Notification::singleton(); $notification->attach('status'); $registry = Registry::singleton(); diff --git a/kronolith/lib/Notification/Listener/status.php b/kronolith/lib/Notification/Listener/Status.php similarity index 76% rename from kronolith/lib/Notification/Listener/status.php rename to kronolith/lib/Notification/Listener/Status.php index ec792d60e..91958a30f 100644 --- a/kronolith/lib/Notification/Listener/status.php +++ b/kronolith/lib/Notification/Listener/Status.php @@ -1,12 +1,8 @@ * @package Horde_Notification */ -class Notification_Listener_status_kronolith extends Notification_Listener_status { - +class Kronolith_Notification_Listener_Status extends Horde_Notification_Listener_Status +{ /** * The notified message stack. * * @var array */ - var $_messageStack = array(); + protected $_messageStack = array(); /** * Returns all status message if there are any on the 'status' message @@ -33,7 +29,7 @@ class Notification_Listener_status_kronolith extends Notification_Listener_statu * @param array &$messageStack The stack of messages. * @param array $options An array of options. */ - function notify(&$messageStack, $options = array()) + public function notify(&$messageStack, $options = array()) { while ($message = array_shift($messageStack)) { $event = @unserialize($message['event']); @@ -53,12 +49,9 @@ class Notification_Listener_status_kronolith extends Notification_Listener_statu * * @return boolean Whether this listener handles the type. */ - function handles($type) + public function handles($type) { - if (substr($type, 0, 10) == 'kronolith.') { - return true; - } - return parent::handles($type); + return (substr($type, 0, 10) == 'kronolith.') || parent::handles($type); } /** @@ -69,7 +62,7 @@ class Notification_Listener_status_kronolith extends Notification_Listener_statu * * @return array List of message hashes. */ - function getStack($encode = false) + public function getStack($encode = false) { $msgs = $this->_messageStack; if (!$encode) { diff --git a/kronolith/lib/base.php b/kronolith/lib/base.php index ca3348bef..5b3f6dc74 100644 --- a/kronolith/lib/base.php +++ b/kronolith/lib/base.php @@ -38,9 +38,8 @@ $conf = &$GLOBALS['conf']; define('KRONOLITH_TEMPLATES', $registry->get('templates')); /* Notification system. */ -$notification = &Notification::singleton(); -require_once KRONOLITH_BASE . '/lib/Notification/Listener/status.php'; -$GLOBALS['kronolith_notify'] = &$notification->attach('status', null, 'Notification_Listener_status_kronolith'); +$notification = &Horde_Notification::singleton(); +$GLOBALS['kronolith_notify'] = &$notification->attach('status', null, 'Kronolith_Notification_Listener_Status'); /* Kronolith base library. */ require_once KRONOLITH_BASE . '/lib/Kronolith.php'; diff --git a/news/lib/base.php b/news/lib/base.php index 5fae630a5..a22f0e4a2 100644 --- a/news/lib/base.php +++ b/news/lib/base.php @@ -34,7 +34,7 @@ $conf = &$GLOBALS['conf']; define('NEWS_TEMPLATES', $registry->get('templates')); // Notification system. -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); $notification->attach('status'); // Define the base file path of News. diff --git a/skoli/lib/base.php b/skoli/lib/base.php index 6d208e171..6f31e129e 100644 --- a/skoli/lib/base.php +++ b/skoli/lib/base.php @@ -32,7 +32,7 @@ $conf = &$GLOBALS['conf']; require_once 'Horde/History.php'; // Notification system. -$notification = &Notification::singleton(); +$notification = &Horde_Notification::singleton(); $notification->attach('status'); // Define the base file path of Skoli. -- 2.11.0