includes[$eventname][] = $include; } $this->functions[$eventname][] = $function; } function trigger($eventname, &$data) { if (isset($this -> includes[$eventname])) { foreach($this->includes[$eventname] as $evt_inc) { if (file_exists($evt_inc)) { include_once($evt_inc); } } } if (isset($this -> functions[$eventname])) { foreach($this->functions[$eventname] as $evt_func) { if (function_exists($evt_func)) { $ret = $evt_func($data); if ($ret!='') { break; } } } } return (isset($ret) ? $ret : false); } } ?>