Fix the return interface of the Html viewer
authorChuck Hagenbuch <chuck@horde.org>
Sat, 2 Oct 2010 21:04:22 +0000 (17:04 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Sat, 2 Oct 2010 21:05:30 +0000 (17:05 -0400)
chora/app/views/file/pretty.html.php
framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php

index cedb2ee..0f215f4 100644 (file)
@@ -10,6 +10,7 @@ if (strpos($this->mimeType, 'text/plain') !== false) {
     echo Horde::img(Horde_Util::addParameter(Horde::selfUrl(true), 'p', 1), '', '', '');
 } elseif ($this->pretty->canRender('inline')) {
     $data = $this->pretty->render('inline');
+    $data = reset($data);
     echo $data['data'];
 } else {
     echo Horde::link(Horde_Util::addParameter(Horde::selfUrl(true), 'p', 1)) . Horde::img('download.png') . ' ' . sprintf(_("Download revision %s"), $r) . '</a>';
index b0094d2..b8d468f 100644 (file)
@@ -95,10 +95,9 @@ class Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Base
     {
         $html = $this->_cleanHTML($this->_mimepart->getContents(), array('inline' => true));
 
-        return array(
-            'data' => Horde_String::convertCharset($html, $this->_mimepart->getCharset(), $this->getConfigParam('charset')),
-            'status' => array(),
-            'type' => 'text/html; charset=' . $this->getConfigParam('charset'),
+        return $this->_renderReturn(
+            Horde_String::convertCharset($html, $this->_mimepart->getCharset(), $this->getConfigParam('charset')),
+            'type' => 'text/html; charset=' . $this->getConfigParam('charset')
         );
     }