Events View code

Class for handling and dispatching system and user defined events.

package

CMS

license

GPL

deprecated

Methods

CreateEvent(string $modulename, string $eventname) 

Inform the system about a new event that can be generated.

deprecated static

Arguments

string $modulename

The name of the module that is sending the event

string $eventname

The name of the event

RemoveEvent(string $modulename, string $eventname) 

Remove an event from the CMS system.

deprecated static

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.

Arguments

string $modulename

The name of the module that is sending the event

string $eventname

The name of the event

SendEvent(string $modulename, string $eventname, array $params = array()) 

Trigger an event.

deprecated static

This function will call all registered event handlers for the event

Arguments

string $modulename

The name of the module that is sending the event

string $eventname

The name of the event

array $params

The parameters associated with this event.

AddEventHandler(string $modulename, string $eventname, string $tag_name = false, string $module_handler = false, boolean $removable = true) : boolean

Add an event handler for a module event.

deprecated static

Arguments

string $modulename

The name of the module sending the event

string $eventname

The name of the event

string $tag_name

The name of a user defined tag. If not passed, no user defined tag is set.

string $module_handler

The name of the module. If not passed, no module is set.

boolean $removable

Can this event be removed from the list? Defaults to true.

Response

boolean

If successful, true. If it fails, false.

RemoveEventHandler(string $modulename, string $eventname, string $tag_name = false, string $module_handler = false) : boolean

Remove an event handler for a particular event.

deprecated static

Arguments

string $modulename

The name of the module sending the event

string $eventname

The name of the event

string $tag_name

The name of a user defined tag. If not passed, no user defined tag is set.

string $module_handler

The name of the module. If not passed, no module is set.

Response

boolean

If successful, true. If it fails, false.