diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-09-20 15:53:28 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-09-20 15:53:28 -0400 |
commit | 2021dccc5a444f60c5ba1673d94b39999912cd26 (patch) | |
tree | 5d805496f001456baa83c0776a32bdb24511511b /app/Helper | |
parent | a0124b45f9dab8a0f7d4879d4ea147b414b25bf2 (diff) |
Move subtask forecast to a plugin
Plugin repo: https://github.com/kanboard/plugin-subtask-forecast
Diffstat (limited to 'app/Helper')
-rw-r--r-- | app/Helper/Hook.php | 10 |
1 files changed, 3 insertions, 7 deletions
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; } } |