Move subtask forecast to a plugin

Plugin repo: https://github.com/kanboard/plugin-subtask-forecast
This commit is contained in:
Frederic Guillot
2015-09-20 15:53:28 -04:00
parent a0124b45f9
commit 2021dccc5a
24 changed files with 275 additions and 172 deletions

View File

@@ -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;
}
}