Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
PluginEngine Class Reference

Static Public Member Functions

static routeRequest ($dispatch_to)
 
static loadPlugins ()
 
static getPlugin ($class)
 
static getPlugins ($type, $context=null)
 
static sendMessage ($type, $method)
 
static sendMessageWithContext ($type, $context, $method)
 
static getURL ($plugin, $params=[], $cmd= 'show', $ignore_registered_params=false)
 
static getLink ($plugin, $params=[], $cmd= 'show', $ignore_registered_params=false)
 

Member Function Documentation

static getLink (   $plugin,
  $params = [],
  $cmd = 'show',
  $ignore_registered_params = false 
)
static

Generates a link (entity encoded URL) which can be shown in user interfaces

Parameters
StudIPPlugin | string$plugin- the plugin to which should be linked
array$params- an array with name value pairs
string$cmd- command to execute by clicking the link
bool$ignore_registered_paramsdo not add registeredparams
Returns
string a link to the current plugin with the additional $params
static getPlugin (   $class)
static

Get instance of the plugin specified by plugin class name.

Parameters
string$classclass name of plugin
static getPlugins (   $type,
  $context = null 
)
static

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
string$typeplugin type or null (all types)
string$contextcontext range id (optional)
Returns
array all plugins of the specified type
static getURL (   $plugin,
  $params = [],
  $cmd = 'show',
  $ignore_registered_params = false 
)
static

Generates a URL which can be shown in user interfaces

Parameters
StudIPPlugin | string$plugin- the plugin to which should be linked
array$params- an array with name value pairs
string$cmd- command to execute by clicking the link
bool$ignore_registered_paramsdo not add registered params
Returns
string a link to the current plugin with the additional $params
static loadPlugins ( )
static

Load the default set of plugins. This currently loads plugins of type Homepage, Standard (if a course is selected), Administration (if user has admin status) and System. The exact type of plugins loaded here may change in the future.

static routeRequest (   $dispatch_to)
static

This function maps an incoming request to a tuple (pluginclassname, unconsumed rest).

Parameters
string$dispatch_to
Returns
array the above mentioned tuple
static sendMessage (   $type,
  $method 
)
static

Sends a message to all activated plugins of a type and returns an array of the return values.

Parameters
string$typeplugin type or null (all types)
string$methodthe method name that should be send to all plugins
mixeda variable number of arguments
Returns
array an array containing the return values
static sendMessageWithContext (   $type,
  $context,
  $method 
)
static

Sends a message to all activated plugins of a type enabled in a context and returns an array of the return values.

Parameters
string$typeplugin type or null (all types)
string$contextcontext range id (may be null)
string$methodthe method name that should be send to all plugins
mixeda variable number of arguments
Returns
array an array containing the return values

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