Status reporting updates.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 11 Nov 2008 20:06:20 +0000 (13:06 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 11 Nov 2008 20:06:20 +0000 (13:06 -0700)
imp/lib/Mime/Viewer/alternative.php
imp/lib/Mime/Viewer/html.php
imp/lib/Mime/Viewer/images.php
imp/lib/Mime/Viewer/related.php

index eebc3f3..5448a8c 100644 (file)
@@ -59,8 +59,10 @@ class IMP_Horde_Mime_Viewer_alternative extends Horde_Mime_Viewer_Driver
         if (is_null($display_id)) {
             return array(
                 'status' => array(
-                    'text' => _("There are no alternative parts that can be displayed inline."),
-                    'type' => 'info'
+                    array(
+                        'text' => array(_("There are no alternative parts that can be displayed inline.")),
+                        'type' => 'info'
+                    )
                 )
             );
         }
index 0d665f1..92d21cd 100644 (file)
@@ -221,7 +221,7 @@ class IMP_Horde_Mime_Viewer_html extends Horde_Mime_Viewer_html
         /* If we are viewing inline, give option to view in separate window. */
         if ($inline && $this->getConfigParam('external')) {
             $cleanhtml['status'][] = array(
-                'data' => $this->_params['contents']->linkViewJS($this->_mimepart, 'view_attach', _("Show this HTML in a new window?")),
+                'text' => array($this->_params['contents']->linkViewJS($this->_mimepart, 'view_attach', _("Show this HTML in a new window?"))),
                 'type' => 'info'
             );
         }
index 44b0267..fb837a7 100644 (file)
@@ -90,17 +90,21 @@ class IMP_Horde_Mime_Viewer_images extends Horde_Mime_Viewer_images
 
         /* The browser cannot view this image. Inform the user of this and
          * ask user if we should convert to another image type. */
-        $msg = _("Your browser does not support inline display of this image type.");
+        $status = array(_("Your browser does not support inline display of this image type."));
 
         /* See if we can convert to an inline browser viewable form. */
         $img = $this->_getHordeImageOb(false);
         if ($img && $GLOBALS['browser']->isViewable($img->getContentType())) {
             $convert_link = $contents->linkViewJS($this->_mimepart, 'view_attach', _("HERE"), null, null, array('img_load_convert' => 1));
-            $msg .= '<br />' . sprintf(_("Click %s to convert the image file into a format your browser can view."), $convert_link);
+            $status[] = sprintf(_("Click %s to convert the image file into a format your browser can view."), $convert_link);
         }
 
         return array(
-            'status' => array('text' => $msg)
+            'status' => array(
+                array(
+                    'text' => $status
+                )
+            }
         );
     }
 
@@ -120,18 +124,21 @@ class IMP_Horde_Mime_Viewer_images extends Horde_Mime_Viewer_images
             return array();
         }
 
-        $status = array(
-            sprintf(_("An image named %s is attached to this message. A thumbnail is below."), $this->_mimepart->getName(true)),
-        );
+        $status = array(sprintf(_("An image named %s is attached to this message. A thumbnail is below."), $this->_mimepart->getName(true)));
 
         if ($GLOBALS['browser']->hasFeature('javascript')) {
-            $status[] = $this->_params['contents']->linkViewJS($this->_mimepart, 'view_attach', Horde::img($this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('img_view_thumbnail' => 1), false), _("View Attachment"), null, ''), null, null, null);
+            $status[] = $this->_params['contents']->linkViewJS($this->_mimepart, 'view_attach', Horde::img($this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('img_view_thumbnail' => 1)), false), _("View Attachment"), null, ''), null, null, null);
         } else {
-            $status[] = Horde::link($this->_params['contents']->urlView($this->_mimepart, 'view_attach')) . Horde::img($this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('img_view_thumbnail' => 1), false), _("View Attachment"), null, '') . '</a>';
+            $status[] = Horde::link($this->_params['contents']->urlView($this->_mimepart, 'view_attach')) . Horde::img($this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('img_view_thumbnail' => 1)), false), _("View Attachment"), null, '') . '</a>';
         }
 
         return array(
-            'status' => array('text' => implode('<br />', $status))
+            'status' => array(
+                array(
+                    'icon' => Horde::img('mime/image.png', _("Thumbnail of attached image")),
+                    'text' => $status
+                )
+            )
         );
     }
 
index c874e62..86c765c 100644 (file)
@@ -55,8 +55,10 @@ class IMP_Horde_Mime_Viewer_related extends Horde_Mime_Viewer_Driver
     {
         return array(
             'status' => array(
-                'text' => sprintf(_("Click %s to view this multipart/related part in a separate window."), $contents->linkViewJS($this->mime_part, 'view_attach', _("HERE"), _("View content in a separate window"))),
-                'icon' => Horde::img('mime/html.png', _("HTML"))
+                array (
+                    'text' => array(sprintf(_("Click %s to view this multipart/related part in a separate window."), $contents->linkViewJS($this->mime_part, 'view_attach', _("HERE"), _("View content in a separate window")))),
+                    'icon' => Horde::img('mime/html.png', _("HTML"))
+                )
             )
         );
     }
@@ -66,7 +68,7 @@ class IMP_Horde_Mime_Viewer_related extends Horde_Mime_Viewer_Driver
      *
      * @param boolean $inline  Are we viewing inline?
      *
-     * @return array  Two elements: html and status.
+     * @return array  See self::render().
      */
     protected function _IMPrender($inline)
     {