Class rcube_plugin_api

Description

The plugin loader and global API

Located in /rcube_plugin_api.php (line 30)


	
			
Variable Summary
 mixed $config
 mixed $dir
 mixed $handlers
 mixed $output
 mixed $url
Method Summary
 void add_content (string $html, string $container)
 void exec_action (string $action)
 array exec_hook (string $hook, [array $args = array()])
 void include_script (string $fn)
 void include_stylesheet (string $fn)
 void init ()
 boolean is_plugin_task (string $task)
 boolean is_processing ([string $hook = null])
 array loaded_plugins ()
 boolean load_plugin (string $plugin_name)
 void register_action (string $action, string $owner, mixed $callback, [string $task = null])
 void register_handler (string $name, string $owner, mixed $callback)
 void register_hook (string $hook, mixed $callback)
 void register_task (string $task, string $owner)
 void unregister_hook (string $hook, mixed $callback)
Variables
mixed $config (line 37)
  • access: public
mixed $dir (line 34)
  • access: public
mixed $handlers = array() (line 39)
  • access: public
mixed $output (line 36)
  • access: public
mixed $url = 'plugins/' (line 35)
  • access: public
Methods
static get_instance (line 87)

This implements the 'singleton' design pattern

  • return: The one and only instance if this class
rcube_plugin_api get_instance ()
add_content (line 438)

Save the given HTML content to be added to a template container

  • access: public
void add_content (string $html, string $container)
  • string $html: HTML content
  • string $container: Template container identifier
exec_action (line 313)

This method handles requests like _task=mail&_action=plugin.foo It executes the callback function that was registered with the given action.

  • access: public
void exec_action (string $action)
  • string $action: Action name
exec_hook (line 256)

Triggers a plugin hook.

This is called from the application and executes all registered handlers

  • return: The (probably) altered hook arguments
  • access: public
array exec_hook (string $hook, [array $args = array()])
  • string $hook: Hook name
  • array $args: Named arguments (key->value pairs)
include_script (line 409)

Include a plugin script file in the current HTML page

  • access: public
void include_script (string $fn)
  • string $fn: Path to script
include_stylesheet (line 423)

Include a plugin stylesheet in the current HTML page

  • access: public
void include_stylesheet (string $fn)
  • string $fn: Path to stylesheet
init (line 112)

Load and init all enabled plugins

This has to be done after rcmail::load_gui() or rcmail::json_init() was called because plugins need to have access to rcmail->output

  • access: public
void init ()
is_plugin_task (line 386)

Checks whether the given task is registered by a plugin

  • return: True if registered, otherwise false
  • access: public
boolean is_plugin_task (string $task)
  • string $task: Task name
is_processing (line 399)

Check if a plugin hook is currently processing.

Mainly used to prevent loops and recursion.

  • return: True if any/the given hook is currently processed, otherwise false
  • access: public
boolean is_processing ([string $hook = null])
  • string $hook: Hook to check (optional)
loaded_plugins (line 449)

Returns list of loaded plugins names

  • return: List of plugin names
  • access: public
array loaded_plugins ()
load_plugin (line 158)

Load the specified plugin

  • return: True on success, false if not loaded or failure
  • access: public
boolean load_plugin (string $plugin_name)
  • string $plugin_name: Plugin name
register_action (line 286)

Let a plugin register a handler for a specific request

  • access: public
void register_action (string $action, string $owner, mixed $callback, [string $task = null])
  • string $action: Action name (_task=mail&_action=plugin.foo)
  • string $owner: Plugin name that registers this action
  • mixed $callback: Callback: string with global function name or array($obj, 'methodname')
  • string $task: Task name registered by this plugin
register_handler (line 333)

Register a handler function for template objects

  • access: public
void register_handler (string $name, string $owner, mixed $callback)
  • string $name: Object name
  • string $owner: Plugin name that registers this action
  • mixed $callback: Callback: string with global function name or array($obj, 'methodname')
register_hook (line 216)

Allows a plugin object to register a callback for a certain hook

  • access: public
void register_hook (string $hook, mixed $callback)
  • string $hook: Hook name
  • mixed $callback: String with global function name or array($obj, 'methodname')
register_task (line 358)

Register this plugin to be responsible for a specific task

  • access: public
void register_task (string $task, string $owner)
  • string $task: Task name (only characters [a-z0-9_.-] are allowed)
  • string $owner: Plugin name that registers this action
unregister_hook (line 239)

Allow a plugin object to unregister a callback.

  • access: public
void unregister_hook (string $hook, mixed $callback)
  • string $hook: Hook name
  • mixed $callback: String with global function name or array($obj, 'methodname')

Documentation generated on Wed, 23 May 2012 16:40:52 +0200 by phpDocumentor 1.4.4