summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorFrédéric Guillot <fguillot@users.noreply.github.com>2014-03-12 22:09:17 -0400
committerFrédéric Guillot <fguillot@users.noreply.github.com>2014-03-12 22:09:17 -0400
commit64ac705c1e9808ee6d3e5d7d6a07514f2e125f99 (patch)
tree8bf44fb03e918657e2a081bb216126f557559184 /core
parent9722cf61520b166454ab7b4cda5b610d56f1fa77 (diff)
Refresh the board only when it's necessary and add a link on the task title
Diffstat (limited to 'core')
-rw-r--r--core/event.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/core/event.php b/core/event.php
index 7addb41d..672146f3 100644
--- a/core/event.php
+++ b/core/event.php
@@ -29,6 +29,14 @@ class Event
private $listeners = array();
/**
+ * The last listener executed
+ *
+ * @access private
+ * @var string
+ */
+ private $lastListener = '';
+
+ /**
* The last triggered event
*
* @access private
@@ -74,12 +82,25 @@ class Event
if (isset($this->listeners[$eventName])) {
foreach ($this->listeners[$eventName] as $listener) {
- $listener->execute($data); // TODO: keep an history of executed actions for unit test
+ if ($listener->execute($data)) {
+ $this->lastListener = get_class($listener);
+ }
}
}
}
/**
+ * Get the last listener executed
+ *
+ * @access public
+ * @return string Event name
+ */
+ public function getLastListenerExecuted()
+ {
+ return $this->lastListener;
+ }
+
+ /**
* Get the last fired event
*
* @access public