From 573a7e5a40e6b3a86066fc62698743eddf424132 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 11 Nov 2008 21:52:57 -0700 Subject: [PATCH] Update plain Viewer. --- framework/Mime/lib/Horde/Mime/Viewer/simple.php | 36 ++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/framework/Mime/lib/Horde/Mime/Viewer/simple.php b/framework/Mime/lib/Horde/Mime/Viewer/simple.php index a416a6787..c931be290 100644 --- a/framework/Mime/lib/Horde/Mime/Viewer/simple.php +++ b/framework/Mime/lib/Horde/Mime/Viewer/simple.php @@ -14,12 +14,40 @@ 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() + ); } } -- 2.11.0