Fix linking images in multipart/related parts.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 2 Jul 2009 19:41:27 +0000 (13:41 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 2 Jul 2009 19:41:27 +0000 (13:41 -0600)
There is no requirement that these content-ids are restricted to images,
so provide a more general method for loading ('related_data' URL
parameter).

imp/lib/Mime/Viewer/Html.php
imp/lib/Mime/Viewer/Images.php

index 10dc519..a893b45 100644 (file)
@@ -156,7 +156,7 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
                 $cid = trim($cid, '<>');
                 if ($cid) {
                     $cid_part = $this->_params['contents']->getMIMEPart($mime_id);
-                    $cid_replace['cid:' . $cid] = $this->_params['contents']->urlView($cid_part, 'view_attach', array('params' => array('img_data' => 1)));
+                    $cid_replace['cid:' . $cid] = $this->_params['contents']->urlView($cid_part, 'view_attach', array('params' => array('related_data' => 1)));
                 }
             }
 
index 6e5eb27..9dc6b07 100644 (file)
@@ -42,7 +42,12 @@ class IMP_Horde_Mime_Viewer_Images extends Horde_Mime_Viewer_Images
      */
     protected function _render()
     {
-        switch (Horde_Util::getFormData('imp_img_view')) {
+        $view = Horde_Util::getFormData('imp_img_view');
+        if (Horde_Util::getFormData('related_data')) {
+            $view = 'data';
+        }
+
+        switch ($view) {
         case 'data':
             /* If calling page is asking us to output data, do that without
              * any further delay and exit. */