This implements the 'singleton' design pattern
Private constructor
rcube_plugin_api
__construct
()
Save the given HTML content to be added to a template container
void
add_content
(string $html, string $container)
-
string
$html: HTML content
-
string
$container: Template container identifier
This method handles requests like _task=mail&_action=plugin.foo It executes the callback function that was registered with the given action.
void
exec_action
(string $action)
-
string
$action: Action name
Triggers a plugin hook.
This is called from the application and executes all registered handlers
array
exec_hook
(string $hook, [array $args = array()])
-
string
$hook: Hook name
-
array
$args: Named arguments (key->value pairs)
Get information about a specific plugin.
This is either provided my a plugin's info() method or extracted from a package.xml or a composer.json file
array
get_info
(string $plugin_name)
-
string
$plugin_name: Plugin name
Include a plugin script file in the current HTML page
void
include_script
(string $fn)
-
string
$fn: Path to script
Include a plugin stylesheet in the current HTML page
void
include_stylesheet
(string $fn)
-
string
$fn: Path to stylesheet
Initialize plugin engine
This has to be done after rcmail::load_gui() or rcmail::json_init() was called because plugins need to have access to rcmail->output
-
object rcube
$app: Instance of the rcube base class
-
string
$task: Current application task (used for conditional plugin loading)
Checks whether the given task is registered by a plugin
boolean
is_plugin_task
(string $task)
Check if a plugin hook is currently processing.
Mainly used to prevent loops and recursion.
boolean
is_processing
([string $hook = null])
-
string
$hook: Hook to check (optional)
Returns list of loaded plugins names
array
loaded_plugins
()
Load the specified plugin
boolean
load_plugin
(string $plugin_name)
-
string
$plugin_name: Plugin name
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
void
load_plugins
(array $plugins_enabled, [array $required_plugins = array()])
-
array
$plugins_enabled: List of configured plugins to load
-
array
$required_plugins: List of plugins required by the application
Let a plugin register a handler for a specific request
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 a handler function for template objects
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')
Allows a plugin object to register a callback for a certain hook
void
register_hook
(string $hook, mixed $callback)
-
string
$hook: Hook name
-
mixed
$callback: String with global function name or array($obj, 'methodname')
Register this plugin to be responsible for a specific task
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
Make the given file name link into the plugins directory
string
resource_url
(string $fn)
Callback for template_container hooks
array
template_container_hook
(array $attrib)
Allow a plugin object to unregister a callback.
void
unregister_hook
(string $hook, mixed $callback)
-
string
$hook: Hook name
-
mixed
$callback: String with global function name or array($obj, 'methodname')