Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

Pluggable Class Reference

Inheritance diagram for Pluggable:

List of all members.

Public Member Functions

 __construct ()
 get_file ()
 get_db_schema ()
 get_url ($trail=false)
 plugin_id ()
 load_text_domain ($domain)
 load ()
 _help_plugin_config ($actions, $plugin_id)
 _help_plugin_ui ($plugin_id, $action)
 _configure_plugin_config ($actions, $plugin_id)
 _configure_plugin_ui ($plugin_id, $action)
 add_rule ($rule, $hook)
 _filter_rewrite_rules ($rules)
 _plugin_available_templates ($list)
 _plugin_include_template_file ($file, $name)
 get_version ()
 upgrade ()

Static Public Member Functions

static load_hooks ($object)

Public Attributes

 $info
 $plugin_id

Protected Member Functions

 add_template ($name, $filename, $override=false)

Protected Attributes

 $_added_templates = array()

Detailed Description

Pluggable class Implements methods that allow descendant classes to register functions to plugin hooks

Version:
$Id$ 2008

Definition at line 14 of file pluggable.php.


Constructor & Destructor Documentation

Pluggable::__construct (  ) 

Pluggable constructor. This function creates some internal structures that are required for plugin processing Plugins should not define their own constructors, because they are instantiated to extract plugin info. Instead, include a sink for a "init" hook which is executed immediately after the plugin is loaded during normal execution.

Reimplemented in Plugin.

Definition at line 29 of file pluggable.php.


Member Function Documentation

Pluggable::_configure_plugin_config ( actions,
plugin_id 
)

Registered to the plugin_config hook to supply a config via a plugin's configure() method

Parameters:
array $actions An array of actions applicable to this plugin
string $plugin_id The plugin id to which the actions belong
Returns:
array The modified array of actions

Definition at line 218 of file pluggable.php.

Pluggable::_configure_plugin_ui ( plugin_id,
action 
)

Registered to the plugin_ui hook to supply a config via a plugin's configure() method

Parameters:
string $plugin_id The id of the plugin whose action was triggered
string $action The action triggered

Definition at line 232 of file pluggable.php.

Pluggable::_filter_rewrite_rules ( rules  ) 

Add the rewrite rules queued by add_rule() to the full rule set

Parameters:
array $rules The array of current RewriteRules
Returns:
array The appended array of RewriteRules

Definition at line 271 of file pluggable.php.

Pluggable::_help_plugin_config ( actions,
plugin_id 
)

Registered to the plugin_config hook to supply help via a plugin's help() method

Parameters:
array $actions An array of actions applicable to this plugin
string $plugin_id The plugin id to which the actions belong
Returns:
array The modified array of actions

Definition at line 184 of file pluggable.php.

Pluggable::_help_plugin_ui ( plugin_id,
action 
)

Registered to the plugin_ui hook to supply help via a plugin's help() method

Parameters:
string $plugin_id The id of the plugin whose action was triggered
string $action The action triggered

Definition at line 198 of file pluggable.php.

Pluggable::_plugin_available_templates ( list  ) 

Add plugin templates to the list of templates that are present in the current theme

Parameters:
array $list List of template names in the current theme
Returns:
array The modified list of template names

Definition at line 303 of file pluggable.php.

Pluggable::_plugin_include_template_file ( file,
name 
)

Potentially serve a different file for the requested template name

Parameters:
string $file The filename of the template the theme will display
string $name The name of the template requested
Returns:
string The potentially modified filename to use for the requested template.

Definition at line 316 of file pluggable.php.

Pluggable::add_rule ( rule,
hook 
)

Add a rewrite rule that dispatches entirely to a plugin hook

Parameters:
mixed $rule An old-style rewrite rule string, where quoted segments are literals and unquoted segments are variable names, OR a RewriteRule object
string $hook The suffix of the hook function: action_plugin_act_{$suffix}

Definition at line 252 of file pluggable.php.

Pluggable::add_template ( name,
filename,
override = false 
) [protected]

Adds a template to the default theme that is stored in a specified path. Use this function as a shortcut to make available additional templates to a theme from within the plugin directory.

Parameters:
string $name The name of the template that will be displayed, sans extension
string $filename The full path of the template file used for the specified name
boolean $override If false, allow a template with the same name in the active theme directory to override this one. If true, always override the active theme's template with this one.

Definition at line 287 of file pluggable.php.

Referenced by CoreBlocks::action_init(), K2::add_template_vars(), Charcoal::add_template_vars(), and CoreDashModules::filter_dash_modules().

Pluggable::get_db_schema (  )  [final]

Gets a database schema associated with this pluggable

Returns:
string The database schema

Definition at line 52 of file pluggable.php.

Pluggable::get_file (  )  [final]

Gets the filename that contains this pluggable class

Returns:
string The filename of the file that contains the pluggable class.

Definition at line 39 of file pluggable.php.

Referenced by get_db_schema(), get_url(), Plugin::info(), load_text_domain(), plugin_id(), and HabariSilo::silo_get().

Pluggable::get_url ( trail = false  ) 

Get a fully-qualified URL directory that contains this pluggable class

Parameters:
bool whether to include a trailing slash. Default: No
Returns:
string URL

Definition at line 65 of file pluggable.php.

Referenced by CoreBlocks::action_block_content_meta_links(), ViddlerSilo::action_init(), HabariSilo::action_init(), CoreDashModules::filter_dash_module_latest_comments(), CoreDashModules::filter_dash_module_latest_entries(), CoreDashModules::filter_dash_module_latest_log_activity(), and HabariSilo::silo_get().

Pluggable::get_version (  )  [abstract]

Provide a method to return the version number from a pluggable's info

Returns:
string The version of the pluggable

Reimplemented in Plugin, and Theme.

Referenced by upgrade().

Pluggable::load (  ) 

Called when a pluggable is loaded to register its actions and filters.

Definition at line 162 of file pluggable.php.

Referenced by Theme::__construct().

static Pluggable::load_hooks ( object  )  [static]

Registers all of this class' action_ and filter_ functions with the Plugins dispatcher Registers xmlrpc_ functions with the Plugins dispatcher, and turns '__' into '.' for the purposes of matching dotted XMLRPC requests. If the class is an instance of Pluggable, registers the hooks with a plugin id also.

Parameters:
mixed $object The object or class name to register the hooks of

Definition at line 101 of file pluggable.php.

Referenced by load().

Pluggable::load_text_domain ( domain  ) 

Load a translation domain/file for this pluggable

Returns:
boolean true if data was successfully loaded, false otherwise

Definition at line 87 of file pluggable.php.

Pluggable::plugin_id (  )  [final]
Pluggable::upgrade (  ) 

Execute the upgrade action on any pluggable that has a version number change Update the version number of the pluggable in the database to what is installed

Definition at line 336 of file pluggable.php.


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