[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/plugin/ -> pluginbase.class.php (sommaire)

\defgroup Plugin There is better documentation concerning plugins in the wiki:

Poids: 431 lignes (13 kb)
Inclus ou requis:0 fois
Référencé: 2 fois
Nécessite: 0 fichiers

Définit 1 class

PluginBase:: (23 méthodes):
  PluginBase()
  getDescription()
  getAuthor()
  getId()
  register()
  setBlogInfo()
  setUserInfo()
  setPluginFolder()
  getPluginFolder()
  registerAdminAction()
  registerBlogAction()
  registerFilter()
  addMenuEntry()
  registerNotification()
  notifyEvent()
  getPluginConfigurationKeys()
  hasPluginConfigurationKeys()
  getPluginDatabaseTables()
  hasLocale()
  process()
  install()
  getVersion()
  getSource()


Classe: PluginBase  - X-Ref

\ingroup Plugin

This is the base class from which every plugin object should inherit.
PluginBase( $source = "" )   X-Ref
Constructor. Feel free to do here whatever you need to.

param: source Only defined to be 'index' or 'admin'. This parameter should be used to determine

getDescription()   X-Ref
Returns a string with some information about the plugin.

return: Returns a string describing the plugin.

getAuthor()   X-Ref
Returns the string describing the author of this plugin.

return: The author of the plugin.

getId()   X-Ref
Returns the identifier of the plugin, the name which can be used
in templates.

return: The plugin identifier.

register()   X-Ref
This function is called only once when the plugin is registered. Please use this method
in case your plugin needs to perform some initializations before it is used, specially
if the initialization process requires access to the plugin/blog settings (because the
BlogInfo and UserInfo objects are not available in the constructor *yet* so this method
will be called once they are available)

return: Nothing.

setBlogInfo( &$blogInfo )   X-Ref


setUserInfo( &$userInfo )   X-Ref


setPluginFolder( $folder )   X-Ref
Changes the folder where plugins are loaded from

param: folder The folder where plugins are stored

getPluginFolder()   X-Ref
Returns the folder where plugins are located, ./plugins by default

return: A string

registerAdminAction( $key, $actionClass )   X-Ref
registers an admin action

param: key
param: actionClass
return: true         

registerBlogAction( $key, $actionClass )   X-Ref
register a blog action

param: key
param: actionClass
return: true

registerFilter( $filterName )   X-Ref
registers a filter for the pipeline

param: filterName Name of the class that implements the pipeline filter. It must implement the
return: true

addMenuEntry( $path, $id, $url, $localeId = null, $orPerms = Array( "manage_plugins" )   X-Ref
Adds a new entry to the admin menu, in case the plugin is registering anything there

param: path The XPath to the option
param: id The identifier of the new option
param: url The url where this new option is pointing to
param: localeId
param: orPerms An array with permissions that will be ORed to determine whether this entry
param: andPerms An array with permission that will be ANDed to determine whether this entry
param: siteAdmin Whether this new option can only be used by site admins        

registerNotification( $eventType )   X-Ref
registers an event plugin

param: eventType
param: eventClass
return: True if successful or false otherwise

notifyEvent( $eventType, $params = Array()   X-Ref
allows the plugin to throw any event, be it one of the core/standard ones
or a new custom one

param: eventType the event code
param: params an associative array with the even parameters, if any
return: true

getPluginConfigurationKeys()   X-Ref
this method should be implemented by plugins, and will tell the plugin manager
which configuration settings are stored in the database by this plugin. This will be
used later on, in case users want to completely remove any trace of this plugin
configuration.

It is not mandatory to do so but it would help.

return: An array of strings containing the configuration keys that are saved in the

hasPluginConfigurationKeys()   X-Ref
Returns true if the plugin has any global configuration key or false otherwise

return: true if the plugin has any global configuration key or false otherwise

getPluginDatabaseTables()   X-Ref
Tells the plugin manager which custom tables have been created by this plugin. It will
help when making a back-up of the database structure, since the back-up feature will be able
to back-up the plugins' database tables too.

return: An array of string with the name of the database tables used by the plugin.

hasLocale( $localeCode )   X-Ref
returns true whether the plugin has the given locale

param: localeCode the locale that we'd like to check
return: whether the plugin provides the requested locale

process( $eventType, $params )   X-Ref
this method must be implemented by plugins that wish to "listen" for events
It will throw an Exception by default, since it means that the plugin registered for
an event but no implementation of the process() method is provided

param: eventType The event identifier.
param: params An array with the parameters thrown by the event. The parameters are

install()   X-Ref
Please use this method to perform any tasks that should be done only once when the plugin is installed
for the first time such as creation of new database tables, etc.
This method will be called every time the "Plugin Centre" page is refreshed, so you should
not assume that this method will be called only once.

return: Always true

getVersion()   X-Ref
returns the plugin version

return: the version of LT for which this plugin was created. This is later on used by the plugin loader

getSource()   X-Ref
Returns the value of the source parameter

param: return Source



Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics