Stud.IP  4.2 Revision
PluginManager Class Reference
Collaboration diagram for PluginManager:
Collaboration graph

Public Member Functions

 setPluginEnabled ($id, $enabled, $force=false)
 
 setPluginPosition ($id, $position)
 
 isPluginActivated ($id, $context)
 
 isPluginActivatedForUser ($pluginId, $userId)
 
 setPluginActivated ($id, $rangeId, $active, $context='sem')
 
 getDefaultActivations ($id)
 
 setDefaultActivations ($id, $institutes)
 
 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)
 

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 checkUserAccess ($plugin, $user)
 
 getCachedPlugin ($plugin_info)
 

Member Function Documentation

◆ checkUserAccess()

checkUserAccess (   $plugin,
  $user 
)
protected

Check user access permission for the given plugin.

Parameters
$pluginplugin meta data
$useruser id of user
Here is the caller graph for this function:

◆ getCachedPlugin()

getCachedPlugin (   $plugin_info)
protected

Get instance of the plugin specified by plugin meta data.

Parameters
$plugin_infoplugin meta data
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDefaultActivations()

getDefaultActivations (   $id)

Returns the list of institutes for which a specific plugin is enabled by default.

Parameters
$idid of the plugin
Here is the call graph for this function:

◆ getInstance()

static getInstance ( )
static

Returns the PluginManager singleton instance.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPlugin()

getPlugin (   $class)

Get instance of the plugin specified by plugin class name.

Parameters
$classclass name of plugin
Here is the call graph for this function:

◆ getPluginById()

getPluginById (   $id)

Get instance of the plugin specified by plugin id.

Parameters
$idid of the plugin
Here is the call graph for this function:

◆ getPluginInfo()

getPluginInfo (   $class)

Get meta data for the plugin specified by plugin class name.

Parameters
$classclass name of plugin
Here is the caller graph for this function:

◆ getPluginInfoById()

getPluginInfoById (   $id)

Get meta data for the plugin specified by plugin id.

Parameters
$idid of the plugin
Here is the caller graph for this function:

◆ 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
$typeplugin type or NULL (all types)
Here is the caller graph for this function:

◆ 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
$typeplugin type or NULL (all types)
$contextcontext range id (optional)
Here is the call graph for this function:

◆ 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
$idid of the plugin
$contextcontext range id
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
$pluginIdid of the plugin
$userIdid of the user
Here is the call graph for this function:

◆ isPluginsDisabled()

isPluginsDisabled ( )

Check whether loading of non-core plugins is currently disabled.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
$nameplugin name
$classplugin class name
$pathplugin relative path
$dependsid of plugin this plugin depends on
Here is the call graph for this function:

◆ setDefaultActivations()

setDefaultActivations (   $id,
  $institutes 
)

Set the list of institutes for which a specific plugin should be enabled by default.

Parameters
$idid of the plugin
$institutesarray of institute ids
Here is the call graph for this function:

◆ setPluginActivated()

setPluginActivated (   $id,
  $rangeId,
  $active,
  $context = 'sem' 
)

Sets the activation status of a plugin in the given context.

Parameters
$idid of the plugin
$rangeIdcontext range id
$activeplugin status (true or false)
$contextcontext of plugin activation
Here is the call graph for this function:

◆ 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
string$idid of the plugin
bool$enabledplugin status (true or false)
bool$forceforce (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.
Here is the call graph for this function:

◆ setPluginPosition()

setPluginPosition (   $id,
  $position 
)

Set the navigation position of the given plugin.

Parameters
$idid of the plugin
$positionplugin navigation position
Returns
bool indicating whether any change occured
Here is the call graph for this function:

◆ setPluginsDisabled()

setPluginsDisabled (   $status)

Disable loading of all non-core plugins for the current session.

Parameters
$statustrue: disable non-core plugins

◆ unregisterPlugin()

unregisterPlugin (   $id)

Remove registration for the given plugin from the data base.

Parameters
$idid of the plugin
Here is the call graph for this function:

The documentation for this class was generated from the following file: