Notification event string representation fixes.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 18 Feb 2010 21:06:48 +0000 (14:06 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 18 Feb 2010 22:56:04 +0000 (15:56 -0700)
framework/Core/lib/Horde/Core/Notification/Status.php
imp/lib/Notification/Event/Status.php

index 676e419..5789361 100644 (file)
@@ -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;
index 2f39cf5..cefc7a9 100644 (file)
@@ -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();
     }
 
 }