Public Member Functions | |
PluginManager ($rootDir) | |
addContentBoxHandle ($mode, $callback) | |
allow a plugin to add an handle to contentBox area | |
addUserActionHandle ($mode, $callback) | |
allow a plugin to add an handle when reacting to user submission | |
addBrowserTitlePageHandle ($mode, $callback) | |
allow a plugin to customize browser title | |
addJavascriptLibs ($mode, $jsLib) | |
allow a plugin to add a javascript lib | |
addPluginCallback ($clb) | |
allow a plugin to add a callback from core code known hooks | |
pluginCallback ($where, &$extra) | |
allow the main site to callback a plugin | |
addPluginACL ($acl_type, $desc) | |
allow a plugin to define a new type of acl | |
getPluginACLs () | |
retrieve all plugin defined ACLs | |
addOnPluginCallback ($clb) | |
allow a plugin to add a callback from core code known hooks | |
onPluginCallback ($where, $data) | |
allow the main site to callback a plugin when reacting to user | |
addValidatePluginCallback ($clb) | |
allow a plugin to validate content from core code known hooks | |
validatePluginCallback ($where, $data, &$reason) | |
allow the main site to callback a plugin when reacting to user | |
importPlugins () | |
called in prepend.inc.php when setuping world : it imports metadata from plugins | |
loadPlugin ($plugin, $mode= '') | |
load a plugin only once. THis is based on plugin name. | |
loadI18N ($plugin) | |
load i18N of plugin only once. THis is based on plugin name. | |
handleMode ($mode, &$hooks) | |
internal function that detects when a plugin is being used, load it, and handle callback | |
contentBoxHandle ($mode) | |
called when handling contentBox by boxes.lib.php, load plugin before handling callback | |
handleUserAction ($mode) | |
called when reacting to user input, load plugin before handling callback | |
browserTitlePageHandle ($mode) | |
called when customizing browser title, load plugin before handling callback | |
Public Attributes | |
$rootDir | |
$toolsBaseDir = 'tools/' | |
tools base dir | |
$contentBoxHandle = array() | |
array(mode)=>array(plugin_name, callback) | |
$userActionHandle = array() | |
array(mode)=>array(plugin_name, callback) | |
$browserTitlePageHandle = array() | |
array(mode)=>array(plugin_name, callback) | |
$javascriptLibs = array() | |
array(mode)=>array(javascript lib) | |
$current_plugin = '' | |
used when importing plugins to properly store plugins info | |
$loaded_plugins = array() | |
list of already loaded plugins | |
$loaded_i18n = array() | |
list of already loaded i18n | |
$pluginCallbacks = array() | |
$onPluginCallbacks = array() | |
$validatePluginCallbacks = array() | |
$pluginACLs = array() | |
array[acl_type=>description] |
enable to load plugin on demand when they are really used. This avoid consuming too much memory/cpu for code that exist but won't be necessary used.
PluginManager::addBrowserTitlePageHandle | ( | $ | mode, | |
$ | callback | |||
) |
allow a plugin to customize browser title
mode | the url mode | |
callback | the callback function to callback when mode is used in url |
PluginManager::addContentBoxHandle | ( | $ | mode, | |
$ | callback | |||
) |
allow a plugin to add an handle to contentBox area
mode | the url mode | |
callback | the callback function to callback when mode is used in url |
PluginManager::addJavascriptLibs | ( | $ | mode, | |
$ | jsLib | |||
) |
allow a plugin to add a javascript lib
mode | the url mode | |
$jsLib | the javascript library to add when plugin is used |
PluginManager::addOnPluginCallback | ( | $ | clb | ) |
allow a plugin to add a callback from core code known hooks
$clb | the new callback to register |
PluginManager::addPluginACL | ( | $ | acl_type, | |
$ | desc | |||
) |
allow a plugin to define a new type of acl
acl_type | acl_type of ACL | |
desc | string describing acl |
PluginManager::addPluginCallback | ( | $ | clb | ) |
allow a plugin to add a callback from core code known hooks
$clb | the new callback to register |
PluginManager::addUserActionHandle | ( | $ | mode, | |
$ | callback | |||
) |
allow a plugin to add an handle when reacting to user submission
mode | the url mode | |
callback | the callback function to callback when mode is used in url |
PluginManager::addValidatePluginCallback | ( | $ | clb | ) |
allow a plugin to validate content from core code known hooks
$clb | the new callback to register |
PluginManager::browserTitlePageHandle | ( | $ | mode | ) |
called when customizing browser title, load plugin before handling callback
PluginManager::contentBoxHandle | ( | $ | mode | ) |
called when handling contentBox by boxes.lib.php, load plugin before handling callback
PluginManager::getPluginACLs | ( | ) |
retrieve all plugin defined ACLs
PluginManager::handleMode | ( | $ | mode, | |
&$ | hooks | |||
) |
internal function that detects when a plugin is being used, load it, and handle callback
PluginManager::handleUserAction | ( | $ | mode | ) |
called when reacting to user input, load plugin before handling callback
PluginManager::importPlugins | ( | ) |
called in prepend.inc.php when setuping world : it imports metadata from plugins
This function is used when setuping world. It lists all plugins found in plugin directory, verify mandatory files are presend (hooks.inc.php and index.php), then require hooks.inc.php so that plugin can callback methods
PluginManager::loadI18N | ( | $ | plugin | ) |
load i18N of plugin only once. THis is based on plugin name.
It is called when the PluginManager detects a plugin us being used, or if the plugin wants to load i18N.
PluginManager::loadPlugin | ( | $ | plugin, | |
$ | mode = '' | |||
) |
load a plugin only once. THis is based on plugin name.
It is called when the PluginManager detects a plugin us being used, or if the plugin wants to load the complete plugin.
PluginManager::onPluginCallback | ( | $ | where, | |
$ | data | |||
) |
allow the main site to callback a plugin when reacting to user
where | is an identifier that can be exploited by a plugin to know which part of the site is calling back | |
data | is an array of data that may be of interest to plugin |
PluginManager::pluginCallback | ( | $ | where, | |
&$ | extra | |||
) |
allow the main site to callback a plugin
where | is an identifier that can be exploited by a plugin to know which part of the site is calling back | |
extra | is an extra parameter that can be of any type, depending of which part of the site is calling back |
PluginManager::validatePluginCallback | ( | $ | where, | |
$ | data, | |||
&$ | reason | |||
) |
allow the main site to callback a plugin when reacting to user
where | is an identifier that can be exploited by a plugin to know which part of the site is calling back | |
data | is an array of data that may be of interest to plugin | |
reason | inout parameter indicating the reason of the validation reject |
PluginManager::$browserTitlePageHandle = array() |
array(mode)=>array(plugin_name, callback)
PluginManager::$contentBoxHandle = array() |
array(mode)=>array(plugin_name, callback)
PluginManager::$current_plugin = '' |
used when importing plugins to properly store plugins info
PluginManager::$javascriptLibs = array() |
array(mode)=>array(javascript lib)
PluginManager::$loaded_i18n = array() |
list of already loaded i18n
PluginManager::$loaded_plugins = array() |
list of already loaded plugins
PluginManager::$pluginACLs = array() |
array[acl_type=>description]
PluginManager::$toolsBaseDir = 'tools/' |
tools base dir
PluginManager::$userActionHandle = array() |
array(mode)=>array(plugin_name, callback)