Update plain Viewer.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 12 Nov 2008 04:52:57 +0000 (21:52 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 12 Nov 2008 04:52:57 +0000 (21:52 -0700)
framework/Mime/lib/Horde/Mime/Viewer/simple.php

index a416a67..c931be2 100644 (file)
 class Horde_Mime_Viewer_simple extends Horde_Mime_Viewer_Driver
 {
     /**
-     * Return the MIME type of the rendered content.
+     * Can this driver render various views?
      *
-     * @return string  MIME-type of the output content.
+     * @var boolean
      */
-    public function getType()
+    protected $_capability = array(
+        'embedded' => false,
+        'full' => true,
+        'info' => false,
+        'inline' => true
+    );
+
+    /**
+     * Return the full rendered version of the Horde_Mime_Part object.
+     *
+     * @return array  See Horde_Mime_Viewer_Driver::render().
+     */
+    protected function _render()
+    {
+        return array(
+            'data' => $this->_mimepart->getContents(),
+            'type' => 'text/plain; charset=' . $this->_mimepart->getCharset()
+        );
+    }
+
+    /**
+     * Return the rendered inline version of the Horde_Mime_Part object.
+     *
+     * @return array  See Horde_Mime_Viewer_Driver::render().
+     */
+    protected function _renderInline()
     {
-        return 'text/plain';
+        return array(
+            'data' => String::convertCharset($this->_mimepart->getContents(), $this->_mimepart->getCharset()),
+            'type' => 'text/plain; charset=' . NLS::getCharset()
+        );
     }
 }