From: Michael M Slusarz Date: Thu, 18 Feb 2010 21:06:48 +0000 (-0700) Subject: Notification event string representation fixes. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a19ef501ae15fe42f9d21f124a9f967a10921086;p=horde.git Notification event string representation fixes. --- diff --git a/framework/Core/lib/Horde/Core/Notification/Status.php b/framework/Core/lib/Horde/Core/Notification/Status.php index 676e41991..5789361bb 100644 --- a/framework/Core/lib/Horde/Core/Notification/Status.php +++ b/framework/Core/lib/Horde/Core/Notification/Status.php @@ -22,7 +22,7 @@ class Horde_Core_Notification_Status extends Horde_Notification_Event_Status */ public function __construct($data, $type = null, array $flags = array()) { - if (is_null($type)) { + if (empty($type)) { $type = ($data instanceof PEAR_Error || $data instanceof Exception) ? 'horde.error' : (is_string($data) ? 'horde.message' : 'horde.error'); @@ -81,26 +81,29 @@ class Horde_Core_Notification_Status extends Horde_Notification_Event_Status case 'horde.error': $img = 'alerts/error.png'; $label = _("Error"); - $text = parent::__toString($this->message); + $text = parent::__toString(); break; case 'horde.message': $img = 'alerts/message.png'; $label = _("Message"); - $text = parent::__toString($this->message); + $text = parent::__toString(); break; case 'horde.success': $img = 'alerts/success.png'; $label = _("Success"); - $text = parent::__toString($this->message); + $text = parent::__toString(); break; case 'horde.warning': $img = 'alerts/warning.png'; $label = _("Warning"); - $text = parent::__toString($this->message); + $text = parent::__toString(); break; + + default: + return parent::__toString(); } return Horde::img($img, $label, null, $GLOBALS['registry']->getImageDir('horde')) . $text; diff --git a/imp/lib/Notification/Event/Status.php b/imp/lib/Notification/Event/Status.php index 2f39cf58b..cefc7a94e 100644 --- a/imp/lib/Notification/Event/Status.php +++ b/imp/lib/Notification/Event/Status.php @@ -36,10 +36,10 @@ class IMP_Notification_Event_Status extends Horde_Core_Notification_Status break; default: - return parent::toString(); + return parent::__toString(); } - return Horde::img($img, $label, null, $GLOBALS['registry']->getImageDir('horde')) . parent::toString(); + return Horde::img($img, $label, null, $GLOBALS['registry']->getImageDir('imp')) . parent::__toString(); } }