| [ Index ] |
PHP Cross Reference of MantisBT |
[Source view] [Print] [Project Stats]
Event API
| Author: | John Reese |
| Copyright: | Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net |
| File Size: | 339 lines (10 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| event_declare( $p_name, $p_type = EVENT_TYPE_DEFAULT ) X-Ref |
| Declare an event of a given type. Will do nothing if event already exists. param: string Event name param: int Event type |
| event_declare_many( $p_events ) X-Ref |
| Convenience function for decleare multiple events. param: array Events |
| event_hook( $p_name, $p_callback, $p_plugin = 0 ) X-Ref |
| Hook a callback function to a given event. A plugin's basename must be specified for proper handling of plugin callbacks. param: string Event name param: string Callback function param: string Plugin basename |
| event_hook_many( $p_hooks, $p_plugin = 0 ) X-Ref |
| Hook multiple callback functions to multiple events. param: array Event name/callback pairs param: string Plugin basename |
| event_clear_callbacks() X-Ref |
| In the case of errors that halt execution, it is useful to clear the list of event callbacks so that no other callbacks are executed while the error message is being displayed. |
| event_signal( $p_name, $p_params = null, $p_params_dynamic = null, $p_type = null ) X-Ref |
| Signal an event to execute and handle callbacks as necessary. param: string Event name param: multi Event parameters param: int Event type override return: multi Null if event undeclared, appropriate return value otherwise |
| event_callback( $p_event, $p_callback, $p_plugin, $p_params = null ) X-Ref |
| Executes a plugin's callback function for a given event. param: string Event name param: string Callback name param: string Plugin basename param: multi Parameters for event callback return: multi Null if callback not found, value from callback otherwise |
| event_type_execute( $p_event, $p_callbacks, $p_params ) X-Ref |
| Process an execute event type. All callbacks will be called with parameters, and their return values will be ignored. param: string Event name param: array Array of callback function/plugin basename key/value pairs param: array Callback parameters |
| event_type_output( $p_event, $p_callbacks, $p_params = null ) X-Ref |
| Process an output event type. All callbacks will be called with the given parameters, and their return values will be echoed to the client, separated by a given string. If there are no callbacks, then nothing will be sent as output. param: string Event name param: array Array of callback function/plugin basename key/value pairs param: multi Output separator (if single string) or indexed array of pre, mid, and post strings |
| event_type_chain( $p_event, $p_callbacks, $p_input, $p_params ) X-Ref |
| Process a chained event type. The first callback with be called with the given input. All following callbacks will be called with the previous's output as its input. The final callback's return value will be returned to the event origin. param: string Event name param: array Array of callback function/plugin basename key/value pairs param: string Input string return: string Output string |
| event_type_first( $p_event, $p_callbacks, $p_params ) X-Ref |
| Process a first-return event. Callbacks will be called with the given parameters until a callback returns a non-null value; at this point, no other callbacks will be processed, and the return value be passed back to the event origin. param: string Event name param: array Array of callback function/plugin basename key/value pairs param: multi Parameters passed to callbacks return: multi The first non-null callback result, or null otherwise |
| event_type_default( $p_event, $p_callbacks, $p_data ) X-Ref |
| Process a default event type. All callbacks will be called with the given data parameters. The return value of each callback will be appended to an array with the callback's basename as the key. This array will then be returned to the event origin. param: string Event name param: array Array of callback function/plugin basename key/value pairs param: multi Data return: array Array of callback/return key/value pairs |
| Generated: Thu Jul 28 15:48:31 2011 | Cross-referenced by PHPXref 0.7 |