'forceinline' => false,
'full' => false,
'info' => false,
- 'inline' => false
+ 'inline' => false,
+ 'raw' => false
);
/**
* the contents of the MIME part. This view is intended to be
* displayed to the user with the intention that this MIME part's
* subparts may also independently be viewed inline.
+ * 'raw' - The raw data of the MIME part, generally useful for downloading
+ * a part. This view exists in case this raw data needs to be
+ * altered in any way.
* </pre>
*
* @return array An array. The keys are the MIME parts that were handled
} catch (Horde_Exception $e) {
$error = $e;
}
+
+ case 'raw':
+ try {
+ return $this->_renderRaw();
+ } catch (Horde_Exception $e) {
+ $error = $e;
+ }
}
// TODO: Error handling
}
/**
+ * Return the rendered information about the Horde_Mime_Part object.
+ *
+ * @return array See Horde_Mime_Viewer_Driver::render().
+ * @throws Horde_Exception
+ */
+ protected function _renderRaw()
+ {
+ $viewer = $this->_getViewer();
+ return $viewer
+ ? $viewer->render('raw')
+ : array();
+ }
+
+ /**
* Can this driver render the the data?
*
- * @param string $mode The mode. Either 'full', 'inline', or 'info'.
+ * @param string $mode The mode. Either 'full', 'inline', 'info', or
+ * 'raw'.
*
* @return boolean True if the driver can render the data for the given
* view.
switch ($mode) {
case 'full':
case 'info':
+ case 'raw':
return $this->_capability[$mode];
case 'inline':
<api>alpha</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Horde_Mime_Part::parseMessage() correctly parses non-MIME parts.
+ <notes>* Add 'raw' render view to Horde_Mime_Viewer.
+ * Horde_Mime_Part::parseMessage() correctly parses non-MIME parts.
* Remove dependence on PEAR's Mail_mimeDecode::.
* Added Horde_Mime::uudecode().
* Remove support for deprecated mime_magic module.