diff --git a/core/event.class.php b/core/event.class.php index abc0f189..67f1bcd7 100644 --- a/core/event.class.php +++ b/core/event.class.php @@ -5,10 +5,17 @@ */ abstract class Event { var $context; + var $vetoed = false; + var $veto_reason; public function __construct(RequestContext $context) { $this->context = $context; } + + public function veto($reason="") { + $this->vetoed = true; + $this->veto_reason = $reason; + } } diff --git a/core/util.inc.php b/core/util.inc.php index 7bda4061..3e262087 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -505,6 +505,7 @@ function send_event($event) { ksort($my_event_listeners); foreach($my_event_listeners as $listener) { $listener->receive_event($event); + if($event->vetoed) break; } $_event_count++; }