Procedural File: event_api.php
Source Location: /core/event_api.php
Page Details:
Event API Handles the event system.
Tags:
array $g_event_cache [line 35]
event_callback [line 170]
multi event_callback(
string $p_event, string $p_callback, string $p_plugin, [multi $p_params = null])
|
|
Executes a plugin's callback function for a given event.
Tags:
Parameters
string |
$p_event |
Event name |
string |
$p_callback |
Callback name |
string |
$p_plugin |
Plugin basename |
multi |
$p_params |
Parameters for event callback |
event_clear_callbacks [line 115]
void event_clear_callbacks(
)
|
|
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_declare [line 44]
void event_declare(
string $p_name, [int $p_type = EVENT_TYPE_DEFAULT])
|
|
Declare an event of a given type. Will do nothing if event already exists.
Tags:
Parameters
string |
$p_name |
Event name |
int |
$p_type |
Event type |
event_declare_many [line 61]
void event_declare_many(
array $p_events)
|
|
Convenience function for decleare multiple events.
Tags:
Parameters
event_hook [line 75]
void event_hook(
string $p_name, string $p_callback, [string $p_plugin = 0])
|
|
Hook a callback function to a given event. A plugin's basename must be specified for proper handling of plugin callbacks.
Tags:
Parameters
string |
$p_name |
Event name |
string |
$p_callback |
Callback function |
string |
$p_plugin |
Plugin basename |
event_hook_many [line 93]
void event_hook_many(
array $p_hooks, [string $p_plugin = 0])
|
|
Hook multiple callback functions to multiple events.
Tags:
Parameters
array |
$p_hooks |
Event name/callback pairs |
string |
$p_plugin |
Plugin basename |
event_signal [line 131]
multi event_signal(
string $p_name, [multi $p_params = null], [int $p_params_dynamic = null], [ $p_type = null])
|
|
Signal an event to execute and handle callbacks as necessary.
Tags:
Parameters
string |
$p_name |
Event name |
multi |
$p_params |
Event parameters |
int |
$p_params_dynamic |
Event type override |
|
$p_type |
|
event_type_chain [line 264]
string event_type_chain(
string $p_event, array $p_callbacks, string $p_input, $p_params)
|
|
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.
Tags:
Parameters
string |
$p_event |
Event name |
array |
$p_callbacks |
Array of callback function/plugin basename key/value pairs |
string |
$p_input |
Input string |
|
$p_params |
|
event_type_default [line 325]
array event_type_default(
string $p_event, array $p_callbacks, multi $p_data)
|
|
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.
Tags:
Parameters
string |
$p_event |
Event name |
array |
$p_callbacks |
Array of callback function/plugin basename key/value pairs |
multi |
$p_data |
Data |
event_type_execute [line 206]
void event_type_execute(
string $p_event, array $p_callbacks, array $p_params)
|
|
Process an execute event type. All callbacks will be called with parameters, and their return values will be ignored.
Tags:
Parameters
string |
$p_event |
Event name |
array |
$p_callbacks |
Array of callback function/plugin basename key/value pairs |
array |
$p_params |
Callback parameters |
event_type_first [line 298]
multi event_type_first(
string $p_event, array $p_callbacks, multi $p_params)
|
|
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.
Tags:
Parameters
string |
$p_event |
Event name |
array |
$p_callbacks |
Array of callback function/plugin basename key/value pairs |
multi |
$p_params |
Parameters passed to callbacks |
event_type_output [line 224]
void event_type_output(
string $p_event, array $p_callbacks, [multi $p_params = null])
|
|
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.
Tags:
Parameters
string |
$p_event |
Event name |
array |
$p_callbacks |
Array of callback function/plugin basename key/value pairs |
multi |
$p_params |
Output separator (if single string) or indexed array of pre, mid, and post strings |
|
|