Catch case where using mimp on a javascript browser.
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 12 Oct 2009 11:36:29 +0000 (05:36 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 12 Oct 2009 11:36:29 +0000 (05:36 -0600)
imp/lib/Mime/Viewer/Html.php

index ad55a9c..fed3e47 100644 (file)
@@ -115,12 +115,16 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
         }
 
         $data = $this->_IMPrender(true);
-        $uid = 'htmldata_' . uniqid(mt_rand());
 
-        $data['js'] = array('IMP.iframeInject("' . $uid . '", ' . Horde_Serialize::serialize($data['data'], Horde_Serialize::JSON, $this->_mimepart->getCharset()) . ')');
-        $data['data'] = '<DIV>' . _("Loading...") . '</DIV><IFRAME class="htmlMsgData" id="' . $uid . '" src="javascript:false" frameborder="0" style="display:none"></IFRAME>' .
-            Horde_Util::bufferOutput(array('Horde', 'addScriptFile'), 'imp.js', 'imp');
-        $data['type'] = 'text/html; charset=UTF-8';
+        /* Catch case where using mimp on a javascript browser. */
+        if ($_SESSION['imp']['view'] != 'mimp') {
+            $uid = 'htmldata_' . uniqid(mt_rand());
+
+            $data['js'] = array('IMP.iframeInject("' . $uid . '", ' . Horde_Serialize::serialize($data['data'], Horde_Serialize::JSON, $this->_mimepart->getCharset()) . ')');
+            $data['data'] = '<DIV>' . _("Loading...") . '</DIV><IFRAME class="htmlMsgData" id="' . $uid . '" src="javascript:false" frameborder="0" style="display:none"></IFRAME>' .
+                Horde_Util::bufferOutput(array('Horde', 'addScriptFile'), 'imp.js', 'imp');
+            $data['type'] = 'text/html; charset=UTF-8';
+        }
 
         return array(
             $this->_mimepart->getMimeId() => $data