ZenMagick 0.9.1


org.zenmagick.service.ZMPlugins

Class ZMPlugins

ZMObject
|
+--ZMPlugins

public class ZMPlugins
extends ZMObject

Plugins.

Plugins are similar to zen-cart modules. Basically, ZMPlugin can be used as base class for a zen-cart module (zen-cart will use the properties and methods marked deprecated...).

The plugin type is controlled by the base directory within the plugins directory. Please note that even though it is valid to create payment, shipping and order_total directories/plugins, zen-cart will not (yet) recognize them as such.

For now, plugins are a simple way to add configuration options to zen-cart without the need to write custom installer/uninstaller.Plugins may consist of either:

a single file
In this case the filename is expected to reflect the classname and the class, in turn, to extend from ZMPlugin.
a directory containing multiple files
In this case the convention require a .php with the same name as the directory in the directory, containing the main plugin class. Again, the classname is expected to be the same as the filename (without the .php extension). It is the plugins responsibility to load all other files it depons upon.

Plugins are grouped according to the way they are used/required. Valid groups (subdirectories) are:

request
created for each request

Author:
mano
Version:
$Id: ZMPlugins.php 1061 2008-04-21 23:31:35Z DerManoMann $

Constructor Summary

ZMPlugins()

Create new instance.

Method Summary
static string

filterResponse(string contents)

Call filterContents(string) on all available plugin handler.

array

getAllPlugins(string scope, boolean configured)

Get all plugins.

static ZMPlugin

getPluginForId(string id, string type)

Get plugin for the given id.

array

getPluginTypes()

Get a list of available plugin types.

static array

getPluginsForType(string type, string scope, boolean configured)

Get all plugins for the given type.

static void

initPlugins(string type, string scope)

Init all plugins of the given type and scope.

static void

instance()

Get instance.

Methods inherited from org.zenmagick.ZMObject
backtrace, create, log, singleton

Constructor Detail

ZMPlugins

public ZMPlugins()

Create new instance. /


Method Detail

filterResponse

public static string filterResponse(string contents)

Call filterContents(string) on all available plugin handler.

Parameters:
contents - The page contents.
Returns:
The really final contents :0

getAllPlugins

public array getAllPlugins(string scope, boolean configured)

Get all plugins.

Parameters:
scope - The plugin scope; default is ZM_SCOPE_ALL.
configured - If true, return only configured provider: default is true.
Returns:
A list of ZMPlugin instances grouped by type.

getPluginForId

public static ZMPlugin getPluginForId(string id, string type)

Get plugin for the given id.

Parameters:
id - The plugin id.
type - Optional type.
Returns:
A plugin instance or null.

getPluginTypes

public array getPluginTypes()

Get a list of available plugin types.

Returns:
A list of types and their associated directories.

getPluginsForType

public static array getPluginsForType(string type, string scope, boolean configured)

Get all plugins for the given type.

Parameters:
type - The plugin type.
scope - The plugin scope; default is ZM_SCOPE_ALL.
configured - If true, return only configured provider: default is true.
Returns:
A list of ZMPlugin instances.

initPlugins

public static void initPlugins(string type, string scope)

Init all plugins of the given type and scope.

Parameters:
type - The type.
scope - The current scope.

instance

public static void instance()

Get instance. /


ZenMagick 0.9.1