From b8b968ab5610f9b0f9a0479d1e9204dfa0b49b9f Mon Sep 17 00:00:00 2001 From: shish Date: Thu, 12 Jul 2007 08:30:51 +0000 Subject: [PATCH] ability to veto events git-svn-id: file:///home/shish/svn/shimmie2/trunk@268 7f39781d-f577-437e-ae19-be835c7a54ca --- core/event.class.php | 5 +++++ core/util.inc.php | 1 + 2 files changed, 6 insertions(+) diff --git a/core/event.class.php b/core/event.class.php index 351fa8a4..7135637a 100644 --- a/core/event.class.php +++ b/core/event.class.php @@ -4,5 +4,10 @@ * generic parent class */ class Event { + var $_live = true; + + public function veto() { + $this->_live = false; + } } ?> diff --git a/core/util.inc.php b/core/util.inc.php index 5fb34873..ab68df3f 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -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; } }