Abstract Class rcube_plugin

Description

Plugin interface class

  • abstract:

Located in /lib/Roundcube/rcube_plugin.php (line 26)


	
			
Variable Summary
 mixed $home
 string $ID
 boolean $noajax
 boolean $noframe
 string $task
 mixed $urlbase
Method Summary
 static array info ()
 rcube_plugin __construct (rcube_plugin_api $api)
 void add_button (array $p, string $container)
 void add_hook (string $hook, mixed $callback)
 void add_texts (string $dir, [mixed $add2client = false])
 string gettext (string $p)
 void include_script (string $fn)
 void include_stylesheet (string $fn)
 void init ()
 boolean load_config ([string $fname = 'config.inc.php'])
 string local_skin_path ()
 void register_action (string $action, mixed $callback)
 void register_handler (string $name, mixed $callback)
 void register_task (string $task)
 void remove_hook (string $hook, mixed $callback)
 boolean require_plugin (string $plugin_name)
 string url (string $fn)
Variables
array $allowed_prefs (line 69)

A list of config option names that can be modified by the user via user interface (with save-prefs command)

  • access: public
rcube_plugin_api $api (line 40)

Instance of Plugin API

  • access: public
mixed $home (line 71)
  • access: protected
string $ID (line 33)

Class name of the plugin instance

  • access: public
boolean $noajax = false (line 54)

Disables plugin in AJAX requests

  • access: public
boolean $noframe = false (line 61)

Disables plugin in framed mode

  • access: public
string $task (line 47)

Regular expression defining task(s) to bind with

  • access: public
mixed $urlbase (line 72)
  • access: protected
Methods
static info (line 99)

Provide information about this

  • return: Meta information about a plugin or false if not implemented
  • access: public
array info ()
Constructor __construct (line 81)

Default constructor.

  • access: public
rcube_plugin __construct (rcube_plugin_api $api)
add_button (line 324)

Append a button to a certain container

  • see: rcube_remplate::button()
  • access: public
void add_button (array $p, string $container)
  • array $p: Hash array with named parameters (as used in skin templates)
  • string $container: Container name where the buttons should be added to
add_hook (line 146)

Register a callback function for a specific (server-side) hook

  • access: public
void add_hook (string $hook, mixed $callback)
  • string $hook: Hook name
  • mixed $callback: Callback function as string or array with object reference and method name
add_texts (line 170)

Load localized texts from the plugins dir

  • access: public
void add_texts (string $dir, [mixed $add2client = false])
  • string $dir: Directory to search in
  • mixed $add2client: Make texts also available on the client (array with list or true for all)
gettext (line 250)

Wrapper for rcube::gettext() adding the plugin ID as domain

string gettext (string $p)
  • string $p: Message identifier
include_script (line 301)

Make this javascipt file available on the client

  • access: public
void include_script (string $fn)
  • string $fn: File path; absolute or relative to the plugin directory
include_stylesheet (line 311)

Make this stylesheet available on the client

  • access: public
void include_stylesheet (string $fn)
  • string $fn: File path; absolute or relative to the plugin directory
init (line 92)

Initialization method, needs to be implemented by the plugin itself

  • abstract:
void init ()
load_config (line 123)

Load local config file from plugins directory.

The loaded values are patched over the global configuration.

  • return: True on success, false on failure
  • access: public
boolean load_config ([string $fname = 'config.inc.php'])
  • string $fname: Config file name relative to the plugin's folder
local_skin_path (line 372)

Provide path to the currently selected skin folder within the plugin directory with a fallback to the default skin folder.

  • return: Skin path relative to plugins directory
  • access: public
string local_skin_path ()
register_action (line 276)

Register a handler for a specific client-request action

The callback will be executed upon a request like /?_task=mail&_action=plugin.myaction

  • access: public
void register_action (string $action, mixed $callback)
  • string $action: Action name (should be unique)
  • mixed $callback: Callback function as string or array with object reference and method name
register_handler (line 291)

Register a handler function for a template object

When parsing a template for display, tags like <roundcube:object name="plugin.myobject" /> will be replaced by the return value if the registered callback function.

  • access: public
void register_handler (string $name, mixed $callback)
  • string $name: Object name (should be unique and start with 'plugin.')
  • mixed $callback: Callback function as string or array with object reference and method name
register_task (line 260)

Register this plugin to be responsible for a specific task

  • access: public
void register_task (string $task)
  • string $task: Task name (only characters [a-z0-9_-] are allowed)
remove_hook (line 158)

Unregister a callback function for a specific (server-side) hook.

  • access: public
void remove_hook (string $hook, mixed $callback)
  • string $hook: Hook name
  • mixed $callback: Callback function as string or array with object reference and method name
require_plugin (line 110)

Attempt to load the given plugin which is required for the current plugin

  • return: True on success, false on failure
  • access: public
boolean require_plugin (string $plugin_name)
  • string $plugin_name: Plugin name
url (line 346)

Generate an absolute URL to the given resource within the current plugin directory

  • return: Absolute URL to the given resource
  • access: public
string url (string $fn)
  • string $fn: The file name

Documentation generated on Fri, 03 May 2013 12:45:04 +0200 by phpDocumentor 1.4.4