This implements the 'singleton' design pattern
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)
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
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
init
()
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
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
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')