Documentation

Horde_Core_Factory_MimeViewer extends Horde_Core_Factory_Base
in package

A Horde_Injector based Horde_Mime_Viewer factory.

Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2010-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

Properties

$_injector  : Horde_Injector
The injector.
$_config  : array<string|int, mixed>
Driver configuration.

Methods

__construct()  : mixed
Constructor.
create()  : Horde_Mime_Viewer_Base
Attempts to return a concrete Horde_Mime_Viewer object based on the MIME type.
getIcon()  : Horde_Themes_Image
Return the appropriate icon for a MIME object/MIME type.
getViewerCallback()  : Horde_Mime_Viewer_Base
Callback used to return a MIME Viewer object from within certain Viewer drivers.
getViewerConfig()  : array<string|int, mixed>
Gets the configuration for a MIME type.
_getDriverName()  : string
Return the classname of the driver to load.
_getDriver()  : array<string|int, mixed>
Get the driver config for a MIME type.
_loadConfig()  : mixed
Create the driver configuration for an application.

Properties

$_injector

The injector.

protected Horde_Injector $_injector

$_config

Driver configuration.

private array<string|int, mixed> $_config = array()

Methods

__construct()

Constructor.

public __construct(Horde_Injector $injector) : mixed
Parameters
$injector : Horde_Injector

The injector to use.

create()

Attempts to return a concrete Horde_Mime_Viewer object based on the MIME type.

public create(Horde_Mime_Part $mime[, array<string|int, mixed> $opts = array() ]) : Horde_Mime_Viewer_Base
Parameters
$mime : Horde_Mime_Part

An object with the data to be rendered.

$opts : array<string|int, mixed> = array()

Additional options:

  app: (string) The Horde application to search for drivers in.
       DEFAULT: current app
  type: (string) The MIME type to use for loading.
        DEFAULT: Uses MIME type in $mime.
Tags
throws
Horde_Mime_Viewer_Exception
Return values
Horde_Mime_Viewer_Base

The newly created instance.

getIcon()

Return the appropriate icon for a MIME object/MIME type.

public getIcon(Horde_Mime_Part|string $mime[, array<string|int, mixed> $opts = array() ]) : Horde_Themes_Image
Parameters
$mime : Horde_Mime_Part|string

The MIME object or type to query.

$opts : array<string|int, mixed> = array()

Additional options:

'app' - (string) The Horde application to search for drivers in.
        DEFAULT: current app
Return values
Horde_Themes_Image

An object which contains the URI and filesystem location of the image.

getViewerCallback()

Callback used to return a MIME Viewer object from within certain Viewer drivers.

public getViewerCallback(Horde_Mime_Viewer_Base $viewer, Horde_Mime_Part $mime, string $type) : Horde_Mime_Viewer_Base
Parameters
$viewer : Horde_Mime_Viewer_Base

The MIME Viewer driver requesting the new object.

$mime : Horde_Mime_Part

An object with the data to be rendered.

$type : string

The MIME type to use for rendering.

Tags
throws
Horde_Mime_Viewer_Exception
Return values
Horde_Mime_Viewer_Base

The newly created instance.

getViewerConfig()

Gets the configuration for a MIME type.

public getViewerConfig(string $type, string $app) : array<string|int, mixed>
Parameters
$type : string

The MIME type.

$app : string

The current Horde application.

Return values
array<string|int, mixed>

The driver and a list of configuration parameters.

_getDriverName()

Return the classname of the driver to load.

protected _getDriverName(string $driver, string $base) : string
Parameters
$driver : string

Driver name.

$base : string

The base classname.

Tags
throws
Horde_Exception
Return values
string

Classname.

_getDriver()

Get the driver config for a MIME type.

private _getDriver(string $type, string $app) : array<string|int, mixed>
Parameters
$type : string

The MIME type query.

$app : string

The Horde application to search for drivers in.

Return values
array<string|int, mixed>

The driver config.

_loadConfig()

Create the driver configuration for an application.

private _loadConfig(string $app) : mixed
Parameters
$app : string

The Horde application to search for drivers in.


        
On this page

Search results