ability to veto events
git-svn-id: file:///home/shish/svn/shimmie2/trunk@268 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
45343a8ce9
commit
b8b968ab56
2 changed files with 6 additions and 0 deletions
|
@ -4,5 +4,10 @@
|
|||
* generic parent class
|
||||
*/
|
||||
class Event {
|
||||
var $_live = true;
|
||||
|
||||
public function veto() {
|
||||
$this->_live = false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -330,6 +330,7 @@ function send_event($event) {
|
|||
ksort($my_event_listeners);
|
||||
foreach($my_event_listeners as $listener) {
|
||||
$listener->receive_event($event);
|
||||
if(!$event->_live) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue