b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.10) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: Plugins

Source Location: /blogs/inc/_misc/_plugins.class.php

Class Plugins

Direct descendents
Child Class Description
Plugins_no_DB A sub-class of Plugins, just to not load any DB info (which means Plugins and Events).
Plugins_admin A Plugins object that loads all Plugins, not just the enabled ones. This is needed for the backoffice plugin management.

[ Top ]
Property Summary
static string   $sql_load_plugins_table  
boolean   $is_admin_class  
array   $plugin_errors   Errors associated to plugins (during loading), indexed by plugin_ID and error class ("register").

[ Top ]
Method Summary
Plugins   Plugins()   Constructor. Sets $plugins_path and load events.
boolean   are_events_available()   Check if the requested list of events is provided by any or one plugin.
boolean   call_by_code()   Call a specific plugin by its code.
NULL|mixed   call_method()   Call a method on a Plugin.
NULL|mixed   call_method_if_active()   Call a method on a Plugin if it is not deactivated.
int   count_regs()   Count # of registrations of same plugin.
void   discover()   Discover and register all available plugins.
string   filter_contents()   Filter (post) contents by calling the relevant filter plugins.
void   forget_events()   Forget the events a Plugin has registered.
array   get_apply_rendering_values()   Get the list of values for when a rendering Plugin can apply (apply_rendering).
Plugin|false   &get_by_classname()   Get a plugin by its classname.
Plugin   &get_by_code()   Get a specific Plugin by its code.
Plugin|false   &get_by_ID()   Get a specific plugin by its ID.
array   get_enabled_events()   Get a list of (enabled) events for a given Plugin ID.
array   get_list_by_all_events()   Get a list of plugins that provide all given events.
array   get_list_by_event()   Get a list of Plugins for a given event.
array   get_list_by_events()   Get a list of Plugins for a list of events. Every Plugin is only once in this list.
Plugin|false   &get_next()   Get next plugin in the list.
void   get_object_from_cacheplugin_or_create()   Load an object from a Cache plugin or create a new one if we have a cache miss or no caching plugins.
array   get_Plugins_in_group()   Will return an array that contents are references to plugins that have the same group, regardless of the sub_group.
array   get_Plugins_in_sub_group()   Will return an array that contents are references to plugins that have the same group and sub_group.
array   get_plugin_groups()   Get a list of available Plugin groups.
array   get_registered_events()   Get a list of methods that are supported as events out of the Plugin's source file.
array   get_supported_events()   Get the list of supported/available events/hooks.
mixed   get_trigger_event()   Trigger an $event and return an index of $params.
mixed   get_trigger_event_first_return()   Trigger an event and return the first return value of a plugin.
mixed   get_trigger_event_first_true()   The same as get_trigger_event(), but stop when the first Plugin returns true.
boolean   has_event()   Has a plugin a specific event registered/enabled?
void   init_settings()   Init Plugin::Settings and Plugin::UserSettings, either by unsetting them for PHP5's overloading or instantiating them for PHP4.
string|Plugin   &install()   Install a plugin into DB.
Plugin|false   &instantiate()   Callback, which gets used for Results.
NULL|boolean   instantiate_Settings()   Instantiate Settings member of class PluginSettings for the given plugin, if it provides default settings (through Plugin::GetDefaultSettings() and Plugin::GetDefaultUserSettings()).
void   load_events()   (Re)load Plugin Events for enabled (normal use) or all (admin use) plugins.
void   load_plugins_table()   Load Plugins data from T_plugins (only once), ordered by priority.
string   quick()   Quick-render a string with a single plugin and format it for output.
string   render()   Render the content of an item by calling the relevant renderer plugins.
void   restart()   Load plugins table and rewind iterator used by get_next().
boolean   save_events()   Save the events that the plugin provides into DB, while removing obsolete entries (that the plugin does not register anymore).
boolean   set_apply_rendering()   Set the apply_rendering value for a given Plugin ID.
boolean|integer|string   set_code()   Set the code for a given Plugin ID.
boolean   set_event_status()   Set the status of an event for a given Plugin.
void   set_Plugin_status()   Sets the status of a Plugin in DB and registers it into the internal indices when "enabled".
boolean|integer   set_priority()   Set the priority for a given Plugin ID.
void   sort()   Sort the list of $Plugins.
void   sort_Plugin_group()   Callback function to sort plugins by group, sub-group and name.
void   sort_Plugin_name()   Callback function to sort plugins by name.
void   sort_Plugin_priority()   Callback function to sort plugins by priority (and classname, if they have same priority).
void   stop_propagation()   Stop propagation of events to next plugins in trigger_event().
array   trigger_collect()   Trigger an event and return an array of all return values of the relevant plugins.
boolean   trigger_event()   Call all plugins for a given event.
array   trigger_event_first_false()   Call all plugins for a given event, until the first one returns false.
array   trigger_event_first_return()   Call all plugins for a given event, until the first one returns a value (not NULL) (and $search is fulfilled, if given).
array   trigger_event_first_true()   Call all plugins for a given event, until the first one returns true.
integer|NULL   trigger_karma_collect()   Trigger a karma collecting event in order to get Karma percentage.
string   unfilter_contents()   UnFilter (post) contents by calling the relevant filter plugins.
boolean   uninstall()   Uninstall a plugin.
void   unregister()   Un-register a plugin.
array   validate_dependencies()   Validate dependencies of a Plugin.
array   validate_list()   Validate renderer list.

[ Top ]
Properties
static string   $sql_load_plugins_table = '
SELECT plug_ID, plug_priority, plug_classname, plug_code, plug_name, plug_shortdesc, plug_apply_rendering, plug_status, plug_version, plug_spam_weight
FROM T_plugins
WHERE plug_status = "enabled"
ORDER BY plug_priority, plug_classname'
[line 144]
API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]
boolean   $is_admin_class = false [line 154]
API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]
array   $plugin_errors = array() [line 164]

Errors associated to plugins (during loading), indexed by plugin_ID and error class ("register").


[ Top ]
Methods
Constructor Plugins  [line 170]

  Plugins Plugins( )

Constructor. Sets $plugins_path and load events.



[ Top ]
are_events_available  [line 2832]

  boolean are_events_available( array|string $events, [boolean $by_one_plugin = false]  )

Check if the requested list of events is provided by any or one plugin.

Parameters:
array|string   $events:  A single event or a list thereof
boolean   $by_one_plugin:  Make sure there's at least one plugin that provides them all? This is useful for event pairs like "CaptchaPayload" and "CaptchaValidated", which should be served by the same plugin.


[ Top ]
call_by_code  [line 2537]

  boolean call_by_code( string $code, [array $params = array()]  )

Call a specific plugin by its code.

This will call the SkinTag event handler.

Parameters:
string   $code:  plugin code
array   $params:  Associative array of parameters (gets passed to the plugin)


[ Top ]
call_method  [line 2139]

  NULL|mixed call_method( integer $plugin_ID, string $method, array &$params  )

Call a method on a Plugin.

This makes sure that the Timer for the Plugin gets resumed.

Parameters:
integer   $plugin_ID:  Plugin ID
string   $method:  Method name.
array   &$params:  Params (by reference).

API Tags:
Return:  Return value of the plugin's method call or NULL if no such method.


[ Top ]
call_method_if_active  [line 2191]

  NULL|mixed call_method_if_active( integer $plugin_ID, string $method, array &$params  )

Call a method on a Plugin if it is not deactivated.

This is a wrapper around call_method().

Parameters:
integer   $plugin_ID:  Plugin ID
string   $method:  Method name.
array   &$params:  Params (by reference).

API Tags:
Return:  Return value of the plugin's method call or NULL if no such method (or inactive).


[ Top ]
count_regs  [line 1714]

  int count_regs( string $classname  )

Count # of registrations of same plugin.

Plugins with negative ID (auto-generated; not installed (yet)) will not get considered.

Parameters:
string   $classname:  class name

API Tags:
Return:  # of regs


[ Top ]
discover  [line 404]

  void discover( )

Discover and register all available plugins.



[ Top ]
filter_contents  [line 2294]

  string filter_contents( string &$title, string &$content, array $renderers  )

Filter (post) contents by calling the relevant filter plugins.

Works very much like render() except that it's called at insert/update time and BEFORE validation. Gives an opportunity to do some serious cleanup on what the user has typed.

This uses the list of renderers, because filtering may need to work in conjunction with rendering, e-g: code display: you want to filter out tags before validation and later you want to render color/fixed font. For brute force filtering, use 'always' or 'stealth' modes.

Parameters:
string   &$title:  title to render (by reference)
string   &$content:  content to render (by reference)
array   $renderers:  renderer codes to use for opt-out, opt-in and lazy

API Tags:
Return:  rendered content
See:  Plugins::render()


[ Top ]
forget_events  [line 1438]

  void forget_events( $plugin_ID  )

Forget the events a Plugin has registered.

This gets used when unregistering a Plugin or if Plugin::PluginInit() returned false, which means "do not use it for subsequent events in the request".

Parameters:
   $plugin_ID: 


[ Top ]
get_apply_rendering_values  [line 379]

  array get_apply_rendering_values( [boolean $with_desc = false]  )

Get the list of values for when a rendering Plugin can apply (apply_rendering).

Parameters:
boolean   $with_desc:  Return an associative array with description for the values?

Information Tags:
Todo:  Add descriptions.

[ Top ]
get_by_classname  [line 2642]

  Plugin|false &get_by_classname( $classname  )

Get a plugin by its classname.

Parameters:
   $classname: 


[ Top ]
get_by_code  [line 2665]

  Plugin &get_by_code( string $plugin_code  )

Get a specific Plugin by its code.

Parameters:
string   $plugin_code:  plugin code

API Tags:
Return:  (false in case of error)


[ Top ]
get_by_ID  [line 2598]

  Plugin|false &get_by_ID( integer $plugin_ID  )

Get a specific plugin by its ID.

This is the workhorse when it comes to lazy-instantiate a Plugin.

Parameters:
integer   $plugin_ID:  plugin ID


[ Top ]
get_enabled_events  [line 2795]

  array get_enabled_events( integer $plugin_ID  )

Get a list of (enabled) events for a given Plugin ID.

Parameters:
integer   $plugin_ID:  Plugin ID


[ Top ]
get_list_by_all_events  [line 2749]

  array get_list_by_all_events( $events  )

Get a list of plugins that provide all given events.

Parameters:
   $events: 

API Tags:
Return:  plugin_ID => & Plugin


[ Top ]
get_list_by_event  [line 2698]

  array get_list_by_event( string $event  )

Get a list of Plugins for a given event.

Parameters:
string   $event:  Event name

API Tags:
Return:  plugin_ID => & Plugin


[ Top ]
get_list_by_events  [line 2724]

  array get_list_by_events( array $events  )

Get a list of Plugins for a list of events. Every Plugin is only once in this list.

Parameters:
array   $events:  Array of events

API Tags:
Return:  plugin_ID => & Plugin


[ Top ]
get_next  [line 1738]

  Plugin|false &get_next( )

Get next plugin in the list.

NOTE: You'll have to call restart() or load_plugins_table() before using it.


API Tags:
Return:  (false if no more plugin).


[ Top ]
get_object_from_cacheplugin_or_create  [line 3089]

  void get_object_from_cacheplugin_or_create( string $objectName, [string $eval_create_object = NULL]  )

Load an object from a Cache plugin or create a new one if we have a cache miss or no caching plugins.

It registers a shutdown function, that refreshes the data to the cache plugin which is not optimal, but we have no hook to see if data retrieved from a DataObjectCache derived class has changed.

Parameters:
string   $objectName:  object name
string   $eval_create_object:  eval this to create the object. Default is to create an object of class $objectName.


[ Top ]
get_Plugins_in_group  [line 574]

  array get_Plugins_in_group( $group  )

Will return an array that contents are references to plugins that have the same group, regardless of the sub_group.

Parameters:
   $group: 


[ Top ]
get_Plugins_in_sub_group  [line 596]

  array get_Plugins_in_sub_group( $group, [ $sub_group = '']  )

Will return an array that contents are references to plugins that have the same group and sub_group.

Parameters:
   $group: 
   $sub_group: 


[ Top ]
get_plugin_groups  [line 549]

  array get_plugin_groups( )

Get a list of available Plugin groups.



[ Top ]
get_registered_events  [line 2878]

  array get_registered_events( $Plugin  )

Get a list of methods that are supported as events out of the Plugin's source file.

Parameters:
   $Plugin: 

Information Tags:
Todo:  Extend to get list of defined classes and global functions and check this list before sourcing/including a Plugin! (prevent fatal error)

[ Top ]
get_supported_events  [line 220]

  array get_supported_events( )

Get the list of supported/available events/hooks.

Additional to the returned event methods (which can be disabled), there are internal ones which just get called on the plugin (and get not remembered in T_pluginevents), e.g.:

  • AfterInstall
  • BeforeEnable
  • BeforeDisable
  • BeforeInstall
  • BeforeUninstall
  • BeforeUninstallPayload
  • DisplaySkin (called on a skin from GetProvidedSkins())
  • ExecCronJob
  • GetDefaultSettings
  • GetDefaultUserSettings
  • GetExtraEvents
  • GetHtsrvMethods
  • PluginInit
  • PluginSettingsUpdateAction (Called as action before updating the plugin's settings)
  • PluginSettingsEditAction (Called as action before editing the plugin's settings)
  • PluginSettingsEditDisplayAfter (Called after standard plugin settings are displayed for editing)
  • PluginSettingsValidateSet (Called before setting a plugin's setting in the backoffice)
  • PluginUserSettingsUpdateAction (Called as action before updating the plugin's user settings)
  • PluginUserSettingsEditAction (Called as action before editing the plugin's settings)
  • PluginUserSettingsEditDisplayAfter (Called after displaying normal user settings)
  • PluginUserSettingsValidateSet (Called before setting a plugin's user setting in the backoffice)
  • PluginVersionChanged (Called when we detect a version change)
The max length of event names is 40 chars (T_pluginevents.pevt_event).


API Tags:
Return:  Name of event (key) => description (value)

Information Tags:
Todo:  Finish/Complete descriptions

[ Top ]
get_trigger_event  [line 1957]

  mixed get_trigger_event( string $event, [array $params = NULL], [string $get = 'data']  )

Trigger an $event and return an index of $params.

Parameters:
string   $event:  Event name, see Plugins::get_supported_events()
array   $params:  Associative array of parameters for the Plugin
string   $get:  Index of $params that should get returned

API Tags:
Return:  The requested index of $params


[ Top ]
get_trigger_event_first_return  [line 1992]

  mixed get_trigger_event_first_return( string $event, [array $params = NULL]  )

Trigger an event and return the first return value of a plugin.

Parameters:
string   $event:  Event name, see Plugins::get_supported_events()
array   $params:  Associative array of parameters for the Plugin

API Tags:
Return:  NULL if no Plugin returned something or the return value of the first Plugin


[ Top ]
get_trigger_event_first_true  [line 1975]

  mixed get_trigger_event_first_true( string $event, [array $params = NULL], [string $get = 'data']  )

The same as get_trigger_event(), but stop when the first Plugin returns true.

Parameters:
string   $event:  Event name, see Plugins::get_supported_events()
array   $params:  Associative array of parameters for the Plugin
string   $get:  Index of $params that should get returned

API Tags:
Return:  The requested index of $params


[ Top ]
has_event  [line 2816]

  boolean has_event( integer $plugin_ID, string $event  )

Has a plugin a specific event registered/enabled?

Parameters:
integer   $plugin_ID: 
string   $event: 


[ Top ]
init_settings  [line 1614]

  void init_settings( Plugin &$Plugin  )

Init Plugin::Settings and Plugin::UserSettings, either by unsetting them for PHP5's overloading or instantiating them for PHP4.

Parameters:
Plugin   &$Plugin: 


[ Top ]
install  [line 663]

  string|Plugin &install( string $classname, [string $plug_status = 'enabled'], [string|NULL $classfile_path = NULL]  )

Install a plugin into DB.

Parameters:
string   $classname:  Classname of the plugin to install
string   $plug_status:  Initial DB Status of the plugin ("enabled", "disabled", "needs_config", "broken")
string|NULL   $classfile_path:  Optional classfile path, if not default (used for tests).

API Tags:
Return:  The installed Plugin (perhaps with $install_dep_notes set) or a string in case of error.


[ Top ]
instantiate  [line 3136]

  Plugin|false &instantiate( $row  )

Callback, which gets used for Results.

Parameters:
   $row: 


[ Top ]
instantiate_Settings  [line 1642]

  NULL|boolean instantiate_Settings( Plugin &$Plugin, string $set_type  )

Instantiate Settings member of class PluginSettings for the given plugin, if it provides default settings (through Plugin::GetDefaultSettings() and Plugin::GetDefaultUserSettings()).

Parameters:
Plugin   &$Plugin: 
string   $set_type:  settings type: "Settings" or "UserSettings"

API Tags:
Return:  NULL, if no Settings


[ Top ]
load_events  [line 2851]

  void load_events( )

(Re)load Plugin Events for enabled (normal use) or all (admin use) plugins.



Redefined in descendants as:

[ Top ]
load_plugins_table  [line 2559]

  void load_plugins_table( )

Load Plugins data from T_plugins (only once), ordered by priority.

This fills the needed indexes to lazy-instantiate a Plugin when requested.



Redefined in descendants as:

[ Top ]
quick  [line 2476]

  string quick( string $plugin_code, array $params  )

Quick-render a string with a single plugin and format it for output.

Parameters:
string   $plugin_code:  Plugin code (must have render() method)
array   $params:  'data': Data to render 'format: format to output, see format_to_output()

API Tags:
Return:  Rendered string


[ Top ]
render  [line 2411]

  string render( string &$content, array $renderers, string $format, array $params, [ $event_prefix = 'Render']  )

Render the content of an item by calling the relevant renderer plugins.

Parameters:
string   &$content:  content to render (by reference)
array   $renderers:  renderer codes to use for opt-out, opt-in and lazy
string   $format:  Output format, see format_to_output(). Only 'htmlbody', 'entityencoded', 'xml' and 'text' are supported.
array   $params:  Additional params to the Render* methods (e.g. "Item" for items). Do not use "data" or "format" here, because it gets used internally.
   $event_prefix: 

API Tags:
Return:  rendered content


[ Top ]
restart  [line 1771]

  void restart( )

Load plugins table and rewind iterator used by get_next().



[ Top ]
save_events  [line 2933]

  boolean save_events( Plugin $Plugin, [array|NULL $enable_events = NULL], [array $disable_events = NULL]  )

Save the events that the plugin provides into DB, while removing obsolete entries (that the plugin does not register anymore).

Parameters:
Plugin   $Plugin:  Plugin to save events for
array|NULL   $enable_events:  List of events to save as enabled for the Plugin. By default all provided events get saved as enabled. Pass array() to discover only new ones.
array   $disable_events:  List of events to save as disabled for the Plugin. By default, no events get disabled. Disabling an event takes priority over enabling.

API Tags:
Return:  True, if events have changed, false if not.


[ Top ]
set_apply_rendering  [line 1570]

  boolean set_apply_rendering( $plugin_ID, $apply_rendering  )

Set the apply_rendering value for a given Plugin ID.

It makes sure that the index is handled and writes it to DB.

Parameters:
   $plugin_ID: 
   $apply_rendering: 

API Tags:
Return:  true if set to new value, false in case of error or if already set to same value


[ Top ]
set_code  [line 1464]

  boolean|integer|string set_code( string $plugin_ID, string $code  )

Set the code for a given Plugin ID.

It makes sure that the index is handled and writes it to DB.

Parameters:
string   $plugin_ID:  Plugin ID
string   $code:  Code to set the plugin to

API Tags:
Return:  true, if already set to same value. string: error message (already in use, wrong format)
  1. in case of setting it into DB (number of affected rows).
false, if invalid Plugin.


[ Top ]
set_event_status  [line 3049]

  boolean set_event_status( $plugin_ID, $plugin_event, $enabled  )

Set the status of an event for a given Plugin.

Parameters:
   $plugin_ID: 
   $plugin_event: 
   $enabled: 

API Tags:
Return:  True, if status has changed; false if not


[ Top ]
set_Plugin_status  [line 626]

  void set_Plugin_status( Plugin &$Plugin, string $status  )

Sets the status of a Plugin in DB and registers it into the internal indices when "enabled".

Otherwise it gets unregistered, but only when we're not in Plugins_admin, because we want to keep it in then in our indices.

{@ object, not $admin_Plugins. }}

Parameters:
Plugin   &$Plugin: 
string   $status:  New status ("enabled", "disabled", "needs_config", "broken")


[ Top ]
set_priority  [line 1529]

  boolean|integer set_priority( $plugin_ID, $priority  )

Set the priority for a given Plugin ID.

It makes sure that the index is handled and writes it to DB.

Parameters:
   $plugin_ID: 
   $priority: 

API Tags:
Return:  true, if already set to same value. false if another Plugin uses that priority already.
  1. in case of setting it into DB.


[ Top ]
sort  [line 444]

  void sort( [string $order = 'priority']  )

Sort the list of $Plugins.

WARNING: do NOT sort by anything else than priority unless you're handling a list of NOT-YET-INSTALLED plugins!

Parameters:
string   $order:  Order: 'priority' (default), 'name'


[ Top ]
sort_Plugin_group  [line 513]

  void sort_Plugin_group( &$a_ID, &$b_ID  )

Callback function to sort plugins by group, sub-group and name.

Those, which have a group get sorted above the ones without one.

WARNING: do NOT sort by anything else than priority unless you're handling a list of NOT-YET-INSTALLED plugins

Parameters:
   &$a_ID: 
   &$b_ID: 


[ Top ]
sort_Plugin_name  [line 497]

  void sort_Plugin_name( &$a_ID, &$b_ID  )

Callback function to sort plugins by name.

WARNING: do NOT sort by anything else than priority unless you're handling a list of NOT-YET-INSTALLED plugins

Parameters:
   &$a_ID: 
   &$b_ID: 


[ Top ]
sort_Plugin_priority  [line 477]

  void sort_Plugin_priority( &$a_ID, &$b_ID  )

Callback function to sort plugins by priority (and classname, if they have same priority).

Parameters:
   &$a_ID: 
   &$b_ID: 


[ Top ]
stop_propagation  [line 1782]

  void stop_propagation( )

Stop propagation of events to next plugins in trigger_event().



[ Top ]
trigger_collect  [line 2014]

  array trigger_collect( string $event, [array $params = NULL], [boolean $ignore_empty = true]  )

Trigger an event and return an array of all return values of the relevant plugins.

Parameters:
string   $event:  Event name, see Plugins::get_supported_events()
array   $params:  Associative array of parameters for the Plugin
boolean   $ignore_empty:  Ignore empty() return values?

API Tags:
Return:  List of return values, indexed by Plugin ID


[ Top ]
trigger_event  [line 1795]

  boolean trigger_event( string $event, [array $params = NULL]  )

Call all plugins for a given event.

Parameters:
string   $event:  event name, see Plugin::get_supported_events()
array   $params:  Associative array of parameters for the Plugin

API Tags:
Return:  True, if at least one plugin has been called.


[ Top ]
trigger_event_first_false  [line 1864]

  array trigger_event_first_false( string $event, [array $params = NULL]  )

Call all plugins for a given event, until the first one returns false.

Parameters:
string   $event:  event name, see Plugin::get_supported_events()
array   $params:  Associative array of parameters for the Plugin

API Tags:
Return:  The (modified) params array with key "plugin_ID" set to the last called plugin; Empty array if no Plugin returned true or no Plugin has this event registered.


[ Top ]
trigger_event_first_return  [line 1904]

  array trigger_event_first_return( string $event, [array|NULL $params = NULL], [array|NULL $search = NULL]  )

Call all plugins for a given event, until the first one returns a value (not NULL) (and $search is fulfilled, if given).

Parameters:
string   $event:  event name, see Plugin::get_supported_events()
array|NULL   $params:  Associative array of parameters for the Plugin
array|NULL   $search:  If provided, the return value gets checks against this criteria. Can be:
  • ( 'in_array' => 'needle' )

API Tags:
Return:  The (modified) params array with key "plugin_ID" set to the last called plugin and 'plugin_return' set to the return value; Empty array if no Plugin returned true or no Plugin has this event registered.


[ Top ]
trigger_event_first_true  [line 1829]

  array trigger_event_first_true( string $event, [array $params = NULL]  )

Call all plugins for a given event, until the first one returns true.

Parameters:
string   $event:  event name, see Plugin::get_supported_events()
array   $params:  Associative array of parameters for the Plugin

API Tags:
Return:  The (modified) params array with key "plugin_ID" set to the last called plugin; Empty array if no Plugin returned true or no Plugin has this event registered.


[ Top ]
trigger_karma_collect  [line 2045]

  integer|NULL trigger_karma_collect( string $event, array $params  )

Trigger a karma collecting event in order to get Karma percentage.

Parameters:
string   $event:  Event
array   $params:  Params to the event

API Tags:
Return:  Spam Karma (-100 - 100); "100" means "absolutely spam"; NULL if no plugin gave us a karma value


[ Top ]
unfilter_contents  [line 2356]

  string unfilter_contents( string &$title, string &$content, array $renderers  )

UnFilter (post) contents by calling the relevant filter plugins.

This is the opposite of filter_content. It is used to restore some specifcs before editing text. For example, this can be used to replace complex sequences of tags with a custome meta-tag, e-g: <strong> can become <s> for convenient editing.

This uses the list of renderers, because un/filtering may need to work in conjunction with rendering, e-g: code display: you want to filter in/out tags before validation and later you want to render color/fixed font. For brute force unfiltering, use 'always' or 'stealth' modes.

Parameters:
string   &$title:  title to render (by reference)
string   &$content:  content to render (by reference)
array   $renderers:  renderer codes to use for opt-out, opt-in and lazy

API Tags:
Return:  rendered content
See:  Plugins::render()
See:  Plugins::filter()

Information Tags:
Todo:  fp> it would probably make sense to do the unfiltering in reverse order compared to filtering

[ Top ]
uninstall  [line 787]

  boolean uninstall( $plugin_ID  )

Uninstall a plugin.

Removes the Plugin, its Settings and Events from the database.

Parameters:
   $plugin_ID: 

API Tags:
Return:  True on success


[ Top ]
unregister  [line 1392]

  void unregister( &$Plugin  )

Un-register a plugin.

This does not un-install it from DB, just from the internal indexes.

Parameters:
   &$Plugin: 


[ Top ]
validate_dependencies  [line 844]

  array validate_dependencies( Plugin &$Plugin, string $mode  )

Validate dependencies of a Plugin.

Parameters:
Plugin   &$Plugin: 
string   $mode:  Mode of check: either 'enable' or 'disable'

API Tags:
Return:  The key 'note' holds an array of notes (recommendations), the key 'error' holds a list of messages for dependency errors.


[ Top ]
validate_list  [line 2209]

  array validate_list( [array $renderers = array('default')]  )

Validate renderer list.

Parameters:
array   $renderers:  renderer codes ('default' will include all "opt-out"-ones)

API Tags:
Return:  validated array of renderer codes


[ Top ]

Documentation generated on Tue, 20 May 2008 01:44:28 +0200 by phpDocumentor 1.4.2