3 # FILE: PluginManager.php
5 # Part of the ScoutLib application support library
6 # Copyright 2009-2013 Edward Almasy and Internet Scout Research Group
7 # http://scout.wisc.edu
15 # ----- PUBLIC INTERFACE -------------------------------------------------
117 "Name" => $this->Name,
118 "Version" => $this->Version,
119 "Description" => $this->Description,
120 "Author" => $this->Author,
122 "Email" => $this->
Email,
123 "EnabledByDefault" => $this->EnabledByDefault,
124 "Requires" => $this->Requires,
125 "CfgSetup" => $this->CfgSetup,
126 "CfgPage" => $this->CfgPage,
127 "Instructions" => $this->Instructions,
140 if (func_num_args() > 1)
142 if ($NewValue === NULL)
144 unset($this->Cfg[$SettingName]);
148 $this->Cfg[$SettingName] = $NewValue;
150 if (is_callable($this->CfgSaveCallback))
152 call_user_func_array($this->CfgSaveCallback,
153 array(get_class($this), $this->Cfg));
156 return isset($this->Cfg[$SettingName]) ? $this->Cfg[$SettingName] : NULL;
160 # ----- PROTECTED INTERFACE ----------------------------------------------
205 # ----- PRIVATE INTERFACE ------------------------------------------------
210 private $CfgSaveCallback;
217 final public function SetAllCfg($NewValues)
219 $this->Cfg = $NewValues;
229 final public function SetCfgSaveCallback($Callback)
231 $this->CfgSaveCallback = $Callback;
Install()
Perform any work needed when the plugin is first installed (for example, creating database tables)...
$Email
Contact email for the plugin's author.
Register()
Set the plugin attributes.
Upgrade($PreviousVersion)
Perform any work needed when the plugin is upgraded to a new version (for example, adding fields to database tables).
$EnabledByDefault
Whether the plugin should be enabled by default when installed.
$Version
Version number of plugin in the format X.X.X (for example: 1.2.12).
$Author
Name of the plugin's author.
HookEvents()
Hook methods to be called when specific events occur.
$CfgSetup
Associative array describing the configuration values for the plugin.
$Requires
Array with plugin base (class) names for the index and minimum version numbers for the values...
SetUpConfigOptions()
Set up plugin configuration options.
DeclareEvents()
Declare events defined by this plugin.
Base class for all plugins.
GetAttributes()
Retrieve plugin information.
$CfgPage
Name of configuration page for plugin.
$Description
Text description of the plugin.
$Name
Proper (human-readable) name of plugin.
Initialize()
Initialize the plugin.
$Url
Web address for more information about the plugin.
ConfigSetting($SettingName, $NewValue=NULL)
Get/set plugin configuration setting.
$Instructions
Instructions for configuring the plugin (displayed on the automatically-generated configuration page ...
Uninstall()
Perform any work needed when the plugin is uninstalled.