From 2021dccc5a444f60c5ba1673d94b39999912cd26 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 20 Sep 2015 15:53:28 -0400 Subject: Move subtask forecast to a plugin Plugin repo: https://github.com/kanboard/plugin-subtask-forecast --- app/Helper/Hook.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'app/Helper') diff --git a/app/Helper/Hook.php b/app/Helper/Hook.php index 77756757..d7fe3d34 100644 --- a/app/Helper/Hook.php +++ b/app/Helper/Hook.php @@ -10,8 +10,6 @@ namespace Helper; */ class Hook extends \Core\Base { - private $hooks = array(); - /** * Render all attached hooks * @@ -24,10 +22,8 @@ class Hook extends \Core\Base { $buffer = ''; - foreach ($this->hooks as $name => $template) { - if ($hook === $name) { - $buffer .= $this->template->render($template, $variables); - } + foreach ($this->hook->getListeners($hook) as $template) { + $buffer .= $this->template->render($template, $variables); } return $buffer; @@ -43,7 +39,7 @@ class Hook extends \Core\Base */ public function attach($hook, $template) { - $this->hooks[$hook] = $template; + $this->hook->on($hook, $template); return $this; } } -- cgit v1.2.3