CoreAPI
[ class tree: CoreAPI ] [ index: CoreAPI ] [ all elements ]

Procedural File: event_api.php

Source Location: /core/event_api.php



Page Details:

Event API Handles the event system.



Tags:

author:  John Reese
version:  $Id$
copyright:  Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
link:  http://www.mantisbt.org
uses:  pluging_api.php
uses:  error_api.php





array $g_event_cache [line 35]

Default value:   array()


[ Top ]






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:

return:  Null if callback not found, value from callback otherwise
access:  public


Parameters

string   $p_event   Event name
string   $p_callback   Callback name
string   $p_plugin   Plugin basename
multi   $p_params   Parameters for event callback
[ Top ]



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.



[ Top ]



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:

access:  public


Parameters

string   $p_name   Event name
int   $p_type   Event type
[ Top ]



event_declare_many [line 61]

void event_declare_many( array $p_events)

Convenience function for decleare multiple events.



Tags:

access:  public


Parameters

array   $p_events   Events
[ Top ]



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:

access:  public


Parameters

string   $p_name   Event name
string   $p_callback   Callback function
string   $p_plugin   Plugin basename
[ Top ]



event_hook_many [line 93]

void event_hook_many( array $p_hooks, [string $p_plugin = 0])

Hook multiple callback functions to multiple events.



Tags:

access:  public


Parameters

array   $p_hooks   Event name/callback pairs
string   $p_plugin   Plugin basename
[ Top ]



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:

return:  Null if event undeclared, appropriate return value otherwise
access:  public


Parameters

string   $p_name   Event name
multi   $p_params   Event parameters
int   $p_params_dynamic   Event type override
   $p_type  
[ Top ]



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:

return:  Output string
access:  public


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  
[ Top ]



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:

return:  Array of callback/return key/value pairs
access:  public


Parameters

string   $p_event   Event name
array   $p_callbacks   Array of callback function/plugin basename key/value pairs
multi   $p_data   Data
[ Top ]



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:

access:  public


Parameters

string   $p_event   Event name
array   $p_callbacks   Array of callback function/plugin basename key/value pairs
array   $p_params   Callback parameters
[ Top ]



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:

return:  The first non-null callback result, or null otherwise
access:  public


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
[ Top ]



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:

access:  public


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
[ Top ]



Documentation generated on Sun, 12 Dec 2010 23:50:26 +0900 by phpDocumentor 1.4.3
inserted by FC2 system