ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilRendererFactory Class Reference

Factory that provides access to all available preview renderers. More...

+ Collaboration diagram for ilRendererFactory:

Static Public Member Functions

static getRenderers ()
 Gets an array containing all available preview renderers.
static getRenderer ($preview)
 Gets the renderer that is able to create a preview for the specified preview object.

Static Private Member Functions

static loadAvailableRenderers ()
 Loads the available preview renderers.

Static Private Attributes

static $renderers = null

Detailed Description

Factory that provides access to all available preview renderers.

Author
Stefan Born stefa.nosp@m.n.bo.nosp@m.rn@ph.nosp@m.zh.c.nosp@m.h
Version
$Id$

Definition at line 14 of file class.ilRendererFactory.php.

Member Function Documentation

static ilRendererFactory::getRenderer (   $preview)
static

Gets the renderer that is able to create a preview for the specified preview object.

Parameters
ilPReview$previewThe preview to get the renderer for.
Returns
ilPreviewRenderer A renderer or null if no renderer matches the preview object.

Definition at line 39 of file class.ilRendererFactory.php.

References $preview, $renderers, and getRenderers().

Referenced by ilPreview\create(), and ilPreview\hasPreview().

{
// check each renderer if it supports that preview object
foreach ($renderers as $renderer)
{
if ($renderer->supports($preview))
{
return $renderer;
}
}
// no matching renderer was found
return null;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilRendererFactory::getRenderers ( )
static

Gets an array containing all available preview renderers.

Returns
array All available preview renderers.

Definition at line 27 of file class.ilRendererFactory.php.

References $renderers, and loadAvailableRenderers().

Referenced by ilObjFileAccessSettingsGUI\editPreviewSettings(), and getRenderer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilRendererFactory::loadAvailableRenderers ( )
staticprivate

Loads the available preview renderers.

That is built in renderers and plugins.

Returns
array The available renderers.

Definition at line 61 of file class.ilRendererFactory.php.

References ilPluginAdmin\getPluginObject(), IL_COMP_SERVICE, and ilGhostscriptRenderer\isGhostscriptInstalled().

Referenced by getRenderers().

{
// already loaded?
if (self::$renderers != null)
return;
$r = array();
// get registered and active plugins
global $ilPluginAdmin;
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Preview", "pvre");
foreach ($pl_names as $pl)
{
$plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "Preview", "pvre", $pl);
$r[] = $plugin->getRendererClassInstance();
}
// add default renderers
include_once("./Services/Preview/classes/class.ilImageMagickRenderer.php");
$r[] = new ilImageMagickRenderer();
include_once("./Services/Preview/classes/class.ilGhostscriptRenderer.php");
$r[] = new ilGhostscriptRenderer();
self::$renderers = $r;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilRendererFactory::$renderers = null
staticprivate

Definition at line 20 of file class.ilRendererFactory.php.

Referenced by getRenderer(), and getRenderers().


The documentation for this class was generated from the following file: