CWIS Developer Documentation
|
Base class for all plugins. More...
Public Member Functions | |
Register () | |
Set the plugin attributes. More... | |
SetUpConfigOptions () | |
Set up plugin configuration options. More... | |
Initialize () | |
Initialize the plugin. More... | |
HookEvents () | |
Hook methods to be called when specific events occur. More... | |
DeclareEvents () | |
Declare events defined by this plugin. More... | |
Install () | |
Perform any work needed when the plugin is first installed (for example, creating database tables). More... | |
Upgrade ($PreviousVersion) | |
Perform any work needed when the plugin is upgraded to a new version (for example, adding fields to database tables). More... | |
Uninstall () | |
Perform any work needed when the plugin is uninstalled. More... | |
GetAttributes () | |
Retrieve plugin information. More... | |
GetBaseName () | |
Get plugin base name. More... | |
ConfigSetting ($SettingName, $NewValue=NULL) | |
Get/set plugin configuration setting. More... | |
IsReady ($NewValue=NULL) | |
Get/set whether the plugin is ready for use. More... | |
IsEnabled ($NewValue=NULL) | |
Get/set whether the plugin is enabled. More... | |
IsInstalled ($NewValue=NULL) | |
Get/set whether the plugin is installed. More... | |
InstalledVersion ($NewValue=NULL) | |
Get/set the last version recorded as installed. More... | |
GetName () | |
Get full name of plugin. More... | |
GetDependencies () | |
Get list of plugins upon which this plugin depends (if any). More... | |
__construct () | |
Class constructor – FOR PLUGIN MANAGER USE ONLY. More... | |
Static Public Member Functions | |
static | SetApplicationFramework ($AF) |
Set the application framework to be referenced within plugins. More... | |
Protected Attributes | |
$Author = NULL | |
Name of the plugin's author. More... | |
$Description = NULL | |
Text description of the plugin. More... | |
$Email = NULL | |
Contact email for the plugin's author. More... | |
$EnabledByDefault = FALSE | |
Whether the plugin should be enabled by default when installed. More... | |
$InitializeBefore = array() | |
Plugins that should be initialized after us. More... | |
$InitializeAfter = array() | |
Plugins that should be initialized before us. More... | |
$Instructions = NULL | |
Instructions for configuring the plugin (displayed on the automatically-generated configuration page if configuration values are supplied). More... | |
$Name = NULL | |
Proper (human-readable) name of plugin. More... | |
$Version = NULL | |
Version number of plugin in the format X.X.X (for example: 1.2.12). More... | |
$Url = NULL | |
Web address for more information about the plugin. More... | |
$Requires = array() | |
Array with plugin base (class) names for the index and minimum version numbers for the values. More... | |
$CfgSetup = array() | |
Associative array describing the configuration values for the plugin. More... | |
$CfgPage = NULL | |
Name of configuration page for plugin. More... | |
Static Protected Attributes | |
static | $AF |
Application framework. More... | |
Base class for all plugins.
Definition at line 13 of file Plugin.php.
|
final |
Class constructor – FOR PLUGIN MANAGER USE ONLY.
Plugins should always be retrieved via PluginManager::GetPlugin(), rather than instantiated directly. Plugin child classes should perform any needed setup in Initialize(), rather than using a constructor.
Definition at line 323 of file Plugin.php.
References StdLib\CheckMyCaller(), GetAttributes(), InstalledVersion(), and Register().
|
final |
Get/set plugin configuration setting.
string | $SettingName | Name of configuration value. |
mixed | $NewValue | New setting value. |
Definition at line 155 of file Plugin.php.
References GetBaseName().
Plugin::DeclareEvents | ( | ) |
Declare events defined by this plugin.
This is used when a plugin defines new events that it signals or responds to. Names of these events should begin with the plugin base name, followed by "_EVENT_" and the event name in all caps (for example "MyPlugin_EVENT_MY_EVENT").
Definition at line 75 of file Plugin.php.
|
final |
Retrieve plugin information.
Definition at line 118 of file Plugin.php.
Referenced by __construct().
Plugin::GetBaseName | ( | ) |
Get plugin base name.
Definition at line 143 of file Plugin.php.
Referenced by ConfigSetting(), InstalledVersion(), IsEnabled(), and IsInstalled().
Plugin::GetDependencies | ( | ) |
Get list of plugins upon which this plugin depends (if any).
Definition at line 312 of file Plugin.php.
References $Requires.
Plugin::GetName | ( | ) |
Get full name of plugin.
Definition at line 302 of file Plugin.php.
References $Name.
Plugin::HookEvents | ( | ) |
Hook methods to be called when specific events occur.
For events declared by other plugins the name string should start with the plugin base (class) name followed by "::" and then the event name.
Definition at line 63 of file Plugin.php.
Plugin::Initialize | ( | ) |
Initialize the plugin.
This is called (if the plugin is enabled) after all plugins have been loaded but before any methods for this plugin (other than Register()) have been called.
Definition at line 51 of file Plugin.php.
Plugin::Install | ( | ) |
Perform any work needed when the plugin is first installed (for example, creating database tables).
Definition at line 86 of file Plugin.php.
Plugin::InstalledVersion | ( | $NewValue = NULL | ) |
Get/set the last version recorded as installed.
This should only be set by the plugin manager.
string | $NewValue | New installed version. (OPTIONAL) |
Definition at line 276 of file Plugin.php.
References StdLib\CheckMyCaller(), and GetBaseName().
Referenced by __construct().
Plugin::IsEnabled | ( | $NewValue = NULL | ) |
Get/set whether the plugin is enabled.
(This is the persistent setting for enabling/disabling, not whether the plugin is currently working.)
bool | $NewValue | TRUE to enable, or FALSE to disable. (OPTIONAL) |
Definition at line 224 of file Plugin.php.
References GetBaseName().
Plugin::IsInstalled | ( | $NewValue = NULL | ) |
Get/set whether the plugin is installed.
This should only be set by the plugin manager.
bool | $NewValue | TRUE to mark as installed, or FALSE to mark as not installed. (OPTIONAL) |
Definition at line 248 of file Plugin.php.
References StdLib\CheckMyCaller(), and GetBaseName().
Plugin::IsReady | ( | $NewValue = NULL | ) |
Get/set whether the plugin is ready for use.
bool | $NewValue | TRUE if plugin is ready for use, otherwise FALSE. (OPTIONAL) |
Definition at line 200 of file Plugin.php.
References StdLib\CheckMyCaller().
|
abstract |
Set the plugin attributes.
At minimum this method MUST set $this->Name and $this->Version. This is called when the plugin is loaded, and is normally the only method called for disabled plugins (except for SetUpConfigOptions(), which is called for pages within the plugin configuration interface).
Referenced by __construct().
|
staticfinal |
Set the application framework to be referenced within plugins.
(This is set by the plugin manager.)
object | $AF | ApplicationFramework object. |
Definition at line 378 of file Plugin.php.
References $AF.
Referenced by PluginManager\__construct().
Plugin::SetUpConfigOptions | ( | ) |
Set up plugin configuration options.
This is called if the plugin is enabled and/or when loading the plugin configuration interface. Config options must be set up using this method (rather than going into Register()) whenever their setup references data from outside of the plugin in any fashion. NOTE: This method is called after the Install() or Upgrade() methods are called.
Definition at line 38 of file Plugin.php.
Plugin::Uninstall | ( | ) |
Perform any work needed when the plugin is uninstalled.
Definition at line 109 of file Plugin.php.
Plugin::Upgrade | ( | $PreviousVersion | ) |
Perform any work needed when the plugin is upgraded to a new version (for example, adding fields to database tables).
string | $PreviousVersion | The version number of this plugin that was previously installed. |
Definition at line 99 of file Plugin.php.
|
staticprotected |
Application framework.
Definition at line 410 of file Plugin.php.
Referenced by SetApplicationFramework().
|
protected |
Name of the plugin's author.
Definition at line 387 of file Plugin.php.
|
protected |
Name of configuration page for plugin.
Definition at line 433 of file Plugin.php.
|
protected |
Associative array describing the configuration values for the plugin.
The first index is the name of the configuration setting, and the second indicates the type of information about that setting. For more information please see Implementing CWIS Plugins.
Definition at line 428 of file Plugin.php.
|
protected |
Text description of the plugin.
Definition at line 389 of file Plugin.php.
|
protected |
Contact email for the plugin's author.
Definition at line 391 of file Plugin.php.
|
protected |
Whether the plugin should be enabled by default when installed.
Definition at line 393 of file Plugin.php.
|
protected |
Plugins that should be initialized before us.
Definition at line 397 of file Plugin.php.
|
protected |
Plugins that should be initialized after us.
Definition at line 395 of file Plugin.php.
|
protected |
Instructions for configuring the plugin (displayed on the automatically-generated configuration page if configuration values are supplied).
Definition at line 401 of file Plugin.php.
|
protected |
Proper (human-readable) name of plugin.
Definition at line 403 of file Plugin.php.
Referenced by GetName().
|
protected |
Array with plugin base (class) names for the index and minimum version numbers for the values.
Special indexes of "PHP" may be used to specify a minimum required PHP version or "PHPX_xxx" to specify a required PHP extension, where "xxx" is the extension name (e.g. "PHPX_GD"). The version number value is ignored for PHP extensions.
Definition at line 419 of file Plugin.php.
Referenced by GetDependencies().
|
protected |
Web address for more information about the plugin.
Definition at line 407 of file Plugin.php.
|
protected |
Version number of plugin in the format X.X.X (for example: 1.2.12).
Definition at line 405 of file Plugin.php.