PluginManager Class Reference

manages plugin More...

List of all members.

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]


Detailed Description

manages plugin

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.


Member Function Documentation

PluginManager::addBrowserTitlePageHandle ( mode,
callback 
)

allow a plugin to customize browser title

Parameters:
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

Parameters:
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

Parameters:
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

Parameters:
$clb the new callback to register

PluginManager::addPluginACL ( acl_type,
desc 
)

allow a plugin to define a new type of acl

Parameters:
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

Parameters:
$clb the new callback to register

PluginManager::addUserActionHandle ( mode,
callback 
)

allow a plugin to add an handle when reacting to user submission

Parameters:
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

Parameters:
$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

Returns:
array<acl_type=>description>

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

Parameters:
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

Parameters:
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

Parameters:
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
Returns:
true if content was validated, false otherwise. In the latter case, variable 'reason' indicates the reason.


Member Data Documentation

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)


The documentation for this class was generated from the following file:
Generated on Mon Feb 19 19:11:58 2007 for Wiclear by  doxygen 1.4.7