mixed ExecuteModuleEvent( array event, mixed param1 = NULL, mixed param2 = NULL, mixed param3 = NULL, mixed param4 = NULL, mixed param5 = NULL, mixed param6 = NULL, mixed param7 = NULL, mixed param8 = NULL, mixed param9 = NULL, mixed param10 = NULL )
The function ExecuteModuleEvent runs an event handler. Returns the return value of an event handler.
| Parameter | Description |
|---|---|
| event | Array describing one record containing a link between an event and an event handler. Such records are stored in table b_module_to_module. The following keys are possible.
|
| param1, param2, ... , param10 |
Arbitrary values to be passed to an event handler. |
<?
// check if the forum can be deleted
// the flag that allows or disallows deleting a forum
$bCanDelete = true;
// obtain data on all handlers of "OnBeforeForumDelete" event
// that belongs to the Forum module
$rsEvents = GetModuleEvents("forum", "OnBeforeForumDelete");
while ($arEvent = $rsEvents->Fetch())
{
// run the scheduled handler of "OnBeforeForumDelete"
// if false is returned...
if (ExecuteModuleEvent($arEvent, $del_id)===false)
{
// cannot delete forum
$bCanDelete = false;
break;
}
}
?>
| © 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |