ZMObject
└─ZMPlugin
└─Plugin
public class Plugin
extends ZMPlugin
| Field Summary | |
|---|---|
| final int | Admin context. |
| final int | Store context. |
| final str | internal key constant |
| final str | internal key constant |
| final str | internal key constant |
| Fields inherited from org.zenmagick.core.services.plugins.ZMPlugin | |
|---|---|
| LP_ALL, LP_FOLDER, LP_NONE, LP_PLUGIN | |
| Fields inherited from org.zenmagick.core.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
Plugin(string title, string description, string version) Create new plugin. |
|
| Method Summary | |
|---|---|
| void | addConfigValue(string title, string key, string value, string description, string widget, int sortOrder) Add a configuration value. |
| void | addMenuItem(string id, string title, string function, string menuKey) Add plugin maintenance screen to navigation. |
| mixed | get(string name, mixed default) Here, the $default parameter is always ingnored. |
| string | getConfigPath(string file) Get a plugin config file path. |
| array | Get all the config values. |
| array | Get optional files to be loaded in global scope. |
| array | Get optional installation messages. |
| int | Get the sort order. |
| void | init() Init this plugin. |
| void | install() Install this plugin. |
| boolean | Check if the plugin is enabled. |
| boolean | Check if the plugin is installed. |
| string | pluginURL(string uri, boolean echo) Resolve a plugin relative URI. |
| void | remove(boolean keepSettings) Remove this plugin. |
| void | set(string name, mixed value) Support to set plugin config values by name. |
| void | setEnabled(boolean status) Set the status. |
| void | setGroup(string group) {@inheritDoc} |
| void | setPreferredSortOrder(int sortOrder) Set the preferred sort order. |
| void | setSortOrder(int sortOrder) Set the sort order. |
| Methods inherited from org.zenmagick.core.services.plugins.ZMPlugin | |
|---|---|
| getContext, getDescription, getGroup, getId, getLoaderPolicy, getName, getPluginDirectory, getVersion, init, isEnabled, setContext, setDescription, setEnabled, setGroup, setId, setLoaderPolicy, setName, setPluginDirectory, setVersion | |
| Methods inherited from org.zenmagick.core.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public final int CONTEXT_ADMIN = 2
Admin context.
public final int CONTEXT_STOREFRONT = 1
Store context.
public final str KEY_ENABLED = 'ENABLED'
internal key constant
public final str KEY_PREFIX = 'PLUGIN_'
internal key constant
public final str KEY_SORT_ORDER = 'SORT_ORDER'
internal key constant
public Plugin(string title, string description, string version)
Create new plugin.
public void addConfigValue(string title, string key, string value, string description, string widget, int sortOrder)
Add a configuration value.
If no sort order is specified, entries will be listed in the order they are added. Effectively, this means sort order can be easier accomplished by adding values in the order they should be displayed.
''.null for a default text field.0.public void addMenuItem(string id, string title, string function, string menuKey)
Add plugin maintenance screen to navigation.
The provided function is free to implement content generation in one of two different ways:
null.ZMPluginPage
instance.public mixed get(string name, mixed default)
Here, the $default parameter is always ingnored.
null.null.public string getConfigPath(string file)
Get a plugin config file path.
Return a fully qualified filename; resolved either against the plugin directory or config/.
If neither file exists, the config/ based filename is returned.
public array getConfigValues()
Get all the config values.
ZMConfigValue instances.public array getGlobal()
Get optional files to be loaded in global scope.
Files returned here would typically have an extension different to .php as otherwise the loader will load them as static.
Global
public array getMessages()
Get optional installation messages.
ZMMessage instances.public int getSortOrder()
Get the sort order.
public void init()
Init this plugin.
This method is part of the lifecylce of a plugin during storefront request handling.
Code to set up internal resources should be placed here, rather than in the * constructor.
public void install()
Install this plugin.
This default implementation will automatically create the following settings:
public boolean isEnabled()
Check if the plugin is enabled.
true if the plugin is enabled, false if not.public boolean isInstalled()
Check if the plugin is installed.
true if the plugin is installed, false if not.public string pluginURL(string uri, boolean echo)
Resolve a plugin relative URI.
The given uri is assumed to be relative to the plugin folder.
true, the URL will be echo'ed as well as returned.null.public void remove(boolean keepSettings)
Remove this plugin.
true, the settings will not be removed; default is false.public void set(string name, mixed value)
Support to set plugin config values by name.
public void setEnabled(boolean status)
Set the status.
public void setGroup(string group)
public void setPreferredSortOrder(int sortOrder)
Set the preferred sort order.
public void setSortOrder(int sortOrder)
Set the sort order.
Store plugin base class.
Plugins are NOT compatible with zen-cart modules.
The plugin code (id) is based on the plugin class/file name.