PHP Class Horde_Mime_Viewer_Base, horde

Copyright 2008-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Michael Slusarz ([email protected])
Mostrar archivo Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_capability array This driver's display capabilities.
$_conf array Viewer configuration.
$_metadata array Metadata for the current viewer/data.
$_mimepart Horde_Mime_Part The Horde_Mime_Part object to render.
$_required array Required configuration parameters.

Public Methods

Method Description
__construct ( Horde_Mime_Part $part, array $conf = [] ) Constructor.
canRender ( string $mode ) : boolean Can this driver render the the data?
embeddedMimeParts ( ) : boolean Does this MIME part possibly contain embedded MIME parts?
getConfigParam ( string $param ) : mixed Return a configuration parameter for the current viewer.
getDriver ( ) : string Returns the driver name for the current object.
getEmbeddedMimeParts ( ) : mixed If this MIME part can contain embedded MIME part(s), and those part(s) exist, return a representation of that data.
getMetadata ( string $data ) : mixed Returns metadata information on the viewer/data.
render ( string $mode ) : array Return the rendered version of the Horde_Mime_Part object.
setConfigParam ( string $param, mixed $value ) Sets a configuration parameter for the current viewer.
setMimePart ( Horde_Mime_Part $mime_part ) Sets the Horde_Mime_Part object for the class.

Protected Methods

Method Description
_getEmbeddedMimeParts ( ) : mixed If this MIME part can contain embedded MIME part(s), and those part(s) exist, return a representation of that data.
_getTempFile ( ) : string Returns a temporary file name.
_getViewer ( ) : mixed Return the underlying MIME Viewer for this part.
_render ( ) : array Return the full HTML rendered version of the Horde_Mime_Part object.
_renderFullReturn ( array $data ) : array Internal helper function to add base HTML tags to a render() return array that contains a single MIME part.
_renderInfo ( ) : array Return the rendered information about the Horde_Mime_Part object.
_renderInline ( ) : array Return the rendered inline version of the Horde_Mime_Part object.
_renderRaw ( ) : array Return the raw representation of the Horde_Mime_Part object.
_renderReturn ( string $data = null, string $type = null ) : array Internal helper function to create render data array for a MIME Part object that only has a single part.
_textFilter ( string $text, mixed $driver, array $params = [] ) : string Filter text.

Method Details

__construct() public method

Constructor.
public __construct ( Horde_Mime_Part $part, array $conf = [] )
$part Horde_Mime_Part
$conf array Configuration:
temp_file - (callback) A callback function that returns a temporary
            filename.  Is passed one parameter: a prefix string.
            DEFAULT: Uses Horde_Util::getTempFile().
text_filter - (callback) A callback function used to filter text. Is
              called the same as Horde_Text_Filter::filter().
              DEFAULT: Uses Horde_Text_Filter::filter().

_getEmbeddedMimeParts() protected method

If this MIME part can contain embedded MIME part(s), and those part(s) exist, return a representation of that data.
protected _getEmbeddedMimeParts ( ) : mixed
return mixed A Horde_Mime_Part object representing the embedded data. Returns null if no embedded MIME part(s) exist.

_getTempFile() protected method

Returns a temporary file name.
protected _getTempFile ( ) : string
return string A temp filename.

_getViewer() protected method

Return the underlying MIME Viewer for this part.
protected _getViewer ( ) : mixed
return mixed A Horde_Mime_Viewer object, or false if not found.

_render() protected method

This MUST be text/html data.
protected _render ( ) : array
return array See render().

_renderFullReturn() protected method

Internal helper function to add base HTML tags to a render() return array that contains a single MIME part.
protected _renderFullReturn ( array $data ) : array
$data array See render().
return array See render().

_renderInfo() protected method

Return the rendered information about the Horde_Mime_Part object.
protected _renderInfo ( ) : array
return array See render().

_renderInline() protected method

This MUST be text/html data. This is not a full HTML document - only the HTML necessary to output the part.
protected _renderInline ( ) : array
return array See render().

_renderRaw() protected method

Return the raw representation of the Horde_Mime_Part object.
protected _renderRaw ( ) : array
return array See render().

_renderReturn() protected method

Internal helper function to create render data array for a MIME Part object that only has a single part.
protected _renderReturn ( string $data = null, string $type = null ) : array
$data string The rendered data.
$type string The rendered type.
return array See render().

_textFilter() protected method

Filter text.
protected _textFilter ( string $text, mixed $driver, array $params = [] ) : string
$text string TODO
$driver mixed TODO
$params array TODO
return string The filtered text.

canRender() public method

Can this driver render the the data?
public canRender ( string $mode ) : boolean
$mode string The mode. Either 'full', 'inline', 'info', or 'raw'.
return boolean True if the driver can render the data for the given view.

embeddedMimeParts() public method

Does this MIME part possibly contain embedded MIME parts?
public embeddedMimeParts ( ) : boolean
return boolean True if this driver supports parsing embedded MIME parts.

getConfigParam() public method

Return a configuration parameter for the current viewer.
public getConfigParam ( string $param ) : mixed
$param string The parameter name.
return mixed The value of the parameter; returns null if the parameter doesn't exist.

getDriver() public method

Returns the driver name for the current object.
public getDriver ( ) : string
return string The driver name.

getEmbeddedMimeParts() public method

If this MIME part can contain embedded MIME part(s), and those part(s) exist, return a representation of that data.
public getEmbeddedMimeParts ( ) : mixed
return mixed A Horde_Mime_Part object representing the embedded data. Returns null if no embedded MIME part(s) exist.

getMetadata() public method

Returns metadata information on the viewer/data.
public getMetadata ( string $data ) : mixed
$data string The metadata key.
return mixed The requested information, or null if the key doesn't exist.

render() public method

Return the rendered version of the Horde_Mime_Part object.
public render ( string $mode ) : array
$mode string The mode:
'full' - A full representation of the MIME part, for use in a view
         where the output to the browser can be set to the value
         returned in 'type'. This mode should only return a single
         MIME ID entry for viewing and should not return any status
         information.
'inline' - A representation of the MIME part that can be viewed inline
           on a text/html page that may contain other HTML elements.
'info' - A representation of the MIME part that can be viewed inline
         on an text/html page that may contain other HTML elements.
         This view is not a full view, but rather a condensed view of
         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.
return array An array. The keys are the MIME parts that were handled by the driver. The values are either null (which indicates the driver is recommending that this particular MIME ID should not be displayed) or an array with the following keys:
'data' - (string) The rendered data.
'status' - (array) An array of status information to be displayed to
           the user.  Consists of arrays with the following keys:
           'class' - (string) The class to use for display.
           'img' - (string) An image to display.
           'text' - (array) The text to display.
'type' - (string) The MIME type of the rendered data.

setConfigParam() public method

Sets a configuration parameter for the current viewer.
public setConfigParam ( string $param, mixed $value )
$param string The parameter name.
$value mixed The parameter value.

setMimePart() public method

Sets the Horde_Mime_Part object for the class.
public setMimePart ( Horde_Mime_Part $mime_part )
$mime_part Horde_Mime_Part The object with the data to be rendered.

Property Details

$_capability protected_oe property

This driver's display capabilities.
protected array $_capability
return array

$_conf protected_oe property

Viewer configuration.
protected array $_conf
return array

$_metadata protected_oe property

Metadata for the current viewer/data.
protected array $_metadata
return array

$_mimepart protected_oe property

The Horde_Mime_Part object to render.
protected Horde_Mime_Part $_mimepart
return Horde_Mime_Part

$_required protected_oe property

Required configuration parameters.
protected array $_required
return array