Class for handling and dispatching system and user defined events.
package |
CMS |
---|---|
license |
GPL |
CreateEvent(string $modulename, string $eventname)
string
$modulenameThe name of the module that is sending the event
string
$eventnameThe name of the event
RemoveEvent(string $modulename, string $eventname)
This function removes all handlers to the event, and completely removes all references to this event from the database
Note, only events created by this module can be removed.
string
$modulenameThe name of the module that is sending the event
string
$eventnameThe name of the event
SendEvent(string $modulename, string $eventname, array $params = array())
This function will call all registered event handlers for the event
string
$modulenameThe name of the module that is sending the event
string
$eventnameThe name of the event
array
$paramsThe parameters associated with this event.
ListEventHandlers(string $modulename, string $eventname) : mixed
string
$modulenameThe name of the module sending the event
string
$eventnameThe name of the event
mixed
If successful, an array of arrays, each element in the array contains two elements 'handler_name', and 'module_handler', any one of these could be null. If it fails, false is returned.
ListEvents() : mixed
mixed
If successful, a list of all the known events. If it fails, false
AddEventHandler(string $modulename, string $eventname, string $tag_name = false, string $module_handler = false, boolean $removable = true) : boolean
string
$modulenameThe name of the module sending the event
string
$eventnameThe name of the event
string
$tag_nameThe name of a user defined tag. If not passed, no user defined tag is set.
string
$module_handlerThe name of the module. If not passed, no module is set.
boolean
$removableCan this event be removed from the list? Defaults to true.
boolean
If successful, true. If it fails, false.
RemoveEventHandlerById(integer $handler_id)
integer
$handler_idRemoveEventHandler(string $modulename, string $eventname, string $tag_name = false, string $module_handler = false) : boolean
string
$modulenameThe name of the module sending the event
string
$eventnameThe name of the event
string
$tag_nameThe name of a user defined tag. If not passed, no user defined tag is set.
string
$module_handlerThe name of the module. If not passed, no module is set.
boolean
If successful, true. If it fails, false.
RemoveAllEventHandlers(string $modulename, string $eventname) : boolean
string
$modulenameThe name of the module sending the event
string
$eventnameThe name of the event
boolean
If successful, true. If it fails, false.
OrderHandlerUp(integer $handler_id)
..
integer
$handler_idOrderHandlerDown(integer $handler_id)
..
integer
$handler_idGetEventHelp(string $eventname) : string
string
$eventnameThe name of the event
string
Returns the help string for the event. Empty string if nothing is found.
GetEventDescription(string $eventname) : string
string
$eventnameThe name of the event
string
Returns the description string for the event. Empty string if nothing is found.