User Tools

Site Tools


mantisbt:dynamic_plugin_requirements

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mantisbt:dynamic_plugin_requirements [2007/11/03 13:56]
jreese
mantisbt:dynamic_plugin_requirements [2008/10/29 04:25] (current)
Line 95: Line 95:
   * Output content if necessary   * Output content if necessary
   * Return callback values to event originator if necessary   * Return callback values to event originator if necessary
 +
  
  
Line 115: Line 116:
   * ''register.php'' is the only file required for a plugin to be valid.  It must contain two callbacks for plugin information and event registrations.  This file should only have the following callbacks, but may include additional functions or callbacks for more complex plugins.     * ''register.php'' is the only file required for a plugin to be valid.  It must contain two callbacks for plugin information and event registrations.  This file should only have the following callbacks, but may include additional functions or callbacks for more complex plugins.  
     * ''plugin_callback_<basename>_info()'' - This function must return an array of plugin information, including name, version, ad dependencies.       * ''plugin_callback_<basename>_info()'' - This function must return an array of plugin information, including name, version, ad dependencies.  
-    * ''plugin_callback_<basename>_init()'' - This function must return an array of event names and corresponding function callbacks.+    * ''plugin_callback_<basename>_init()'' - This function must set up the plugin, and hook any events needed.
     * ''plugin_callback_<basename>_schema()'' - This function is only required if the plugin needs to maintain changes or additions to the Mantis schema.  It must return an array of schema upgrades in the same format as the ''admin/schema.php'' upgrade script.     * ''plugin_callback_<basename>_schema()'' - This function is only required if the plugin needs to maintain changes or additions to the Mantis schema.  It must return an array of schema upgrades in the same format as the ''admin/schema.php'' upgrade script.
   * ''events.php'' is required for using event hooks.  It should contain all the event callback functions, or include additional scripts with the necessary callbacks.  All event callback functions must be named as ''plugin_event_callback_<basename>_<name>()'' This script will only be loaded if the plugin has registered for an event.   * ''events.php'' is required for using event hooks.  It should contain all the event callback functions, or include additional scripts with the necessary callbacks.  All event callback functions must be named as ''plugin_event_callback_<basename>_<name>()'' This script will only be loaded if the plugin has registered for an event.
   * ''lang/'' is only required if the plugin needs to use language strings that don't appear in the standard language files.  These files will only be loaded if the requested strings cannot be found otherwise.   * ''lang/'' is only required if the plugin needs to use language strings that don't appear in the standard language files.  These files will only be loaded if the requested strings cannot be found otherwise.
   * ''pages/'' is only required if a plugin needs to have its own pages.  They can be accessed by linking a url returned by the ''plugin_page()'' function.  These pages need not load the core libraries, as it will already be loaded for them.   * ''pages/'' is only required if a plugin needs to have its own pages.  They can be accessed by linking a url returned by the ''plugin_page()'' function.  These pages need not load the core libraries, as it will already be loaded for them.
 +
 +
  
  
Line 155: Line 158:
  
 /** /**
- Register callback methods for any events necessary.+ Intitialize the plugin.
  */  */
-function plugin_callback_supercow_initialize() {+function plugin_callback_supercow_init() {
   plugin_event_hook( 'EVENT_PLUGIN_INIT', 'header' );   plugin_event_hook( 'EVENT_PLUGIN_INIT', 'header' );
 } }
Line 173: Line 176:
 } }
 </code> </code>
 +
  
  
Line 199: Line 203:
   * (vboctor): It should be easy to develop features like Twitter notifications as plug-ins.  Once we do that, then the community can have plugins for all similar services like SMS, Jaiku, Pownce, etc.   * (vboctor): It should be easy to develop features like Twitter notifications as plug-ins.  Once we do that, then the community can have plugins for all similar services like SMS, Jaiku, Pownce, etc.
     * (jreese) Once again, this comes down to picking appropriate and useful events.     * (jreese) Once again, this comes down to picking appropriate and useful events.
 +  * (DGtlRift): In the above explanation and examples should ''plugin_callback_<basename>_register()'' be ''plugin_callback_<basename>_init()''?
mantisbt/dynamic_plugin_requirements.1194112591.txt.gz ยท Last modified: 2008/10/29 04:31 (external edit)