|
| setPluginEnabled ($id, $enabled, $force=false) |
|
| setPluginPosition ($id, $position) |
|
| isPluginActivated ($id, $context) |
|
| isPluginActivatedForUser ($pluginId, $userId) |
|
| setPluginActivated ($id, $rangeId, $active) |
|
| setPluginActivatedForUser ($pluginid, $user_id, $active) |
|
| deactivateAllPluginsForRange ($range_type, $range_id) |
|
| setPluginsDisabled ($status) |
|
| isPluginsDisabled () |
|
| registerPlugin ($name, $class, $path, $depends=null) |
|
| unregisterPlugin ($id) |
|
| getPluginInfo ($class) |
|
| getPluginInfoById ($id) |
|
| getPluginInfos ($type=null) |
|
| getPlugin ($class) |
|
| getPluginById ($id) |
|
| getPlugins ($type, $context=null) |
|
| getPluginManifest ($plugindir) |
|
PluginManager.php - plugin manager for Stud.IP
- Copyright
- 2009 Elmar Ludwig GPL2 or any later version
P of StudIPPlugin
◆ checkUserAccess()
checkUserAccess |
( |
|
$plugin, |
|
|
|
$user_id |
|
) |
| |
|
protected |
Check user access permission for the given plugin.
- Parameters
-
array | $plugin | plugin meta data |
string | $user_id | id of user |
- Returns
- bool
◆ deactivateAllPluginsForRange()
deactivateAllPluginsForRange |
( |
|
$range_type, |
|
|
|
$range_id |
|
) |
| |
Deactivate all plugins for the given range.
- Parameters
-
string | $range_type | Type of range (sem, inst or user) |
string | $range_id | Id of range |
- Returns
- int number of deactivated/removed plugins for range
◆ getCachedPlugin()
getCachedPlugin |
( |
|
$plugin_info | ) |
|
|
protected |
Get instance of the plugin specified by plugin meta data.
- Parameters
-
array | $plugin_info | plugin meta data |
- Returns
- P
◆ getInstance()
◆ getPlugin()
Get instance of the plugin specified by plugin class name.
- Parameters
-
class-string<P> | $class class name of plugin |
- Returns
- P|null
◆ getPluginById()
Get instance of the plugin specified by plugin id.
- Parameters
-
- Returns
- P|null $plugin
◆ getPluginInfo()
Get meta data for the plugin specified by plugin class name.
- Parameters
-
string | $class | class name of plugin |
◆ getPluginInfoById()
Get meta data for the plugin specified by plugin id.
- Parameters
-
◆ getPluginInfos()
getPluginInfos |
( |
|
$type = null | ) |
|
Get meta data for all plugins of the specified type. A type of null returns meta data for all installed plugins.
- Parameters
-
string | $type | plugin type or null (all types) |
◆ getPluginManifest()
getPluginManifest |
( |
|
$plugindir | ) |
|
Read the manifest of the plugin in the given directory. Returns null if the manifest cannot be found.
- Returns
- array containing the manifest information
◆ getPlugins()
getPlugins |
( |
|
$type, |
|
|
|
$context = null |
|
) |
| |
Get instances of all plugins of the specified type. A type of null returns all enabled plugins. The optional context parameter can be used to get only plugins that are activated in the given context.
- Parameters
-
| class-string<P>|null | $type plugin type or null (all types) |
string | $context | context range id (optional) |
- Returns
- P[]|StudIPPlugin[]
◆ isPluginActivated()
isPluginActivated |
( |
|
$id, |
|
|
|
$context |
|
) |
| |
Get the activation status of a plugin in the given context. This also checks the plugin default activations and sem_class-settings.
- Parameters
-
int | $id | id of the plugin |
string | $context | range id |
- Returns
- bool
◆ isPluginActivatedForUser()
isPluginActivatedForUser |
( |
|
$pluginId, |
|
|
|
$userId |
|
) |
| |
Get the activation status of a plugin for the given user. This also checks the plugin default activations and sem_class-settings.
- Parameters
-
int | $pluginId | id of the plugin |
string | $userId | id of the user |
◆ isPluginsDisabled()
Check whether loading of non-core plugins is currently disabled.
◆ registerPlugin()
registerPlugin |
( |
|
$name, |
|
|
|
$class, |
|
|
|
$path, |
|
|
|
$depends = null |
|
) |
| |
Register a new plugin or update an existing plugin entry in the data base. Returns the id of the new or updated plugin.
- Parameters
-
string | $name | plugin name |
string | $class | plugin class name |
string | $path | plugin relative path |
int | $depends | id of plugin this plugin depends on |
◆ setPluginActivated()
setPluginActivated |
( |
|
$id, |
|
|
|
$rangeId, |
|
|
|
$active |
|
) |
| |
Sets the activation status of a plugin in the given context.
- Parameters
-
int | $id | id of the plugin |
string | $rangeId | context range id |
bool | $active | plugin status (true or false) |
◆ setPluginActivatedForUser()
setPluginActivatedForUser |
( |
|
$pluginid, |
|
|
|
$user_id, |
|
|
|
$active |
|
) |
| |
Sets the activation status of a plugin in the given context.
- Parameters
-
int | $pluginid | id of the plugin |
string | $user_id | user id |
bool | $active | plugin status (true or false) |
◆ setPluginEnabled()
setPluginEnabled |
( |
|
$id, |
|
|
|
$enabled, |
|
|
|
$force = false |
|
) |
| |
Set the enabled/disabled status of the given plugin.
If the plugin implements the method "onEnable" or "onDisable", this method will be called accordingly. If the method returns false or throws and exception, the plugin's activation state is not updated.
- Parameters
-
int | $id | id of the plugin |
bool | $enabled | plugin status (true or false) |
bool | $force | force (de)activation regardless of the result of on(en|dis)able |
- Returns
- bool indicating whether the plugin was updated or null if the passed state equals the current state or if the plugin is missing.
◆ setPluginPosition()
setPluginPosition |
( |
|
$id, |
|
|
|
$position |
|
) |
| |
Set the navigation position of the given plugin.
- Parameters
-
int | $id | id of the plugin |
int | $position | plugin navigation position |
- Returns
- bool indicating whether any change occured
◆ setPluginsDisabled()
setPluginsDisabled |
( |
|
$status | ) |
|
Disable loading of all non-core plugins for the current session.
- Parameters
-
bool | $status | true: disable non-core plugins |
◆ unregisterPlugin()
Remove registration for the given plugin from the data base.
- Parameters
-
The documentation for this class was generated from the following file: