ZMObject
└─ZMPlugin
└─Plugin
public class Plugin
extends ZMPlugin
| Constant Summary | |
|---|---|
| final static int | Admin context. |
| final static int | Store context. |
| final static str | internal key constant |
| final static str | internal key constant |
| final static str | internal key constant |
| Method Summary | |
|---|---|
| void | __construct(string title, string description, string version) Create new plugin. |
| 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. |
| void | addMenuItem2(string title, mixed requestId, string menuKey, string id, string function) Add custom plugin admin page to admin navigation. |
| mixed | get(string name, mixed default) Here, the $default parameter is always ingnored. |
| ZMAdminMenu | Get admin menu. |
| 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. |
| boolean | Check if this plugin has options configurable via the default plugin options dialog. |
| 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) 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. |
| boolean | upgrade() Upgrade this plugin. |
| Methods inherited from org.zenmagick.core.services.plugins\ZMPlugin | |
|---|---|
| __construct, 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 | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public final static int CONTEXT_ADMIN = 2
Admin context.
public final static int CONTEXT_STOREFRONT = 1
Store context.
public final static str KEY_ENABLED = 'ENABLED'
internal key constant
public final static str KEY_PREFIX = 'PLUGIN_'
internal key constant
public final static str KEY_SORT_ORDER = 'SORT_ORDER'
internal key constant
public void __construct(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 void addMenuItem2(string title, mixed requestId, string menuKey, string id, string function)
Add custom plugin admin page to admin navigation.
Plugins are expected to implement a corresponding controller for the configured reuqestId.
public mixed get(string name, mixed default)
Here, the $default parameter is always ingnored.
null.null.public ZMAdminMenu getAdminMenu()
Get admin menu.
null if not available.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(ZMRequest request)
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.
public array getMessages()
Get optional installation messages.
ZMMessage instances.public int getSortOrder()
Get the sort order.
public boolean hasOptions()
Check if this plugin has options configurable via the default plugin options dialog.
true if options are available.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)
Resolve a plugin relative URI.
The given uri is assumed to be relative to the plugin folder.
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)
Set the group.
public void setPreferredSortOrder(int sortOrder)
Set the preferred sort order.
public void setSortOrder(int sortOrder)
Set the sort order.
public boolean upgrade()
Upgrade this plugin.
true on success.
Store plugin base class.
Plugins are NOT compatible with zen-cart modules.
The plugin code (id) is based on the plugin class/file name.