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

Public Member Functions

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

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,
  $context = NULL 
)
protected

Get instance of the plugin specified by plugin meta data.

Parameters
$plugin_infoplugin meta data
$contextcontext range id (optional)
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 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:

◆ 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 
)

Set the enabled/disabled status of the given plugin.

Triggers a PluginDidEnable or respectively PluginDidDisable notification. The plugin's ID is transmitted as subject of the notification.

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

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