PHP Class Horde_Core_Factory_MimeViewer, horde

Inheritance: extends Horde_Core_Factory_Base
Datei anzeigen Open project: horde/horde Class Usage Examples

Public Methods

Method Description
create ( Horde_Mime_Part $mime, array $opts = [] ) : Horde_Mime_Viewer_Base Attempts to return a concrete Horde_Mime_Viewer object based on the MIME type.
getIcon ( Horde_Mime_Part | string $mime, array $opts = [] ) : Horde_Themes_Image Return the appropriate icon for a MIME object/MIME type.
getViewerCallback ( Horde_Mime_Viewer_Base $viewer, Horde_Mime_Part $mime, string $type ) : Horde_Mime_Viewer_Base Callback used to return a MIME Viewer object from within certain Viewer drivers.
getViewerConfig ( string $type, string $app ) : array Gets the configuration for a MIME type.

Private Methods

Method Description
_getDriver ( string $type, string $app ) : array Get the driver config for a MIME type.
_loadConfig ( string $app ) Create the driver configuration for an application.

Method Details

create() public method

Attempts to return a concrete Horde_Mime_Viewer object based on the MIME type.
public create ( Horde_Mime_Part $mime, array $opts = [] ) : Horde_Mime_Viewer_Base
$mime Horde_Mime_Part An object with the data to be rendered.
$opts 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.
return Horde_Mime_Viewer_Base The newly created instance.

getIcon() public method

Return the appropriate icon for a MIME object/MIME type.
public getIcon ( Horde_Mime_Part | string $mime, array $opts = [] ) : Horde_Themes_Image
$mime Horde_Mime_Part | string The MIME object or type to query.
$opts array Additional options:
'app' - (string) The Horde application to search for drivers in.
        DEFAULT: current app
return Horde_Themes_Image An object which contains the URI and filesystem location of the image.

getViewerCallback() public method

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
$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.
return Horde_Mime_Viewer_Base The newly created instance.

getViewerConfig() public method

Gets the configuration for a MIME type.
public getViewerConfig ( string $type, string $app ) : array
$type string The MIME type.
$app string The current Horde application.
return array The driver and a list of configuration parameters.