mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-14 16:02:14 +09:00
Allow triggers to call arbitrary functions
This commit is contained in:
parent
9f35a3c95b
commit
74ac1e5141
3 changed files with 46 additions and 2 deletions
|
|
@ -60,6 +60,24 @@ class moduleController extends module
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add trigger callback function
|
||||
*
|
||||
* @param string $trigger_name
|
||||
* @param string $called_position
|
||||
* @param callable $callback_function
|
||||
*/
|
||||
function insertTriggerFunction($trigger_name, $called_position, $callback_function)
|
||||
{
|
||||
if(!isset($GLOBALS['__trigger_functions__']))
|
||||
{
|
||||
$GLOBALS['__trigger_functions__'] = array();
|
||||
}
|
||||
|
||||
$GLOBALS['__trigger_functions__'][$trigger_name][$called_position][] = $callback_function;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add module trigger
|
||||
* module trigger is to call a trigger to a target module
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue