From 20f33fb097abb08c8c5fbb64574c25665332d783 Mon Sep 17 00:00:00 2001 From: Gert Date: Wed, 20 May 2015 17:19:12 +0200 Subject: [PATCH] implement twig template registering in admin plugin --- admin.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/admin.php b/admin.php index 71f93f6d..e58d4b05 100644 --- a/admin.php +++ b/admin.php @@ -8,6 +8,7 @@ use Grav\Common\Page\Pages; use Grav\Common\Plugin; use Grav\Common\Uri; use RocketTheme\Toolbox\File\File; +use RocketTheme\Toolbox\Event\Event; use RocketTheme\Toolbox\Session\Session; class AdminPlugin extends Plugin @@ -185,8 +186,13 @@ class AdminPlugin extends Plugin */ public function onTwigTemplatePaths() { + $twig_paths = []; + $this->grav->fireEvent('onAdminTwigTemplatePaths', new Event(['paths' => &$twig_paths])); + + $twig_paths[] = __DIR__ . '/themes/' . $this->theme . '/templates'; + + $this->grav['twig']->twig_paths = $twig_paths; - $this->grav['twig']->twig_paths = array(__DIR__ . '/themes/' . $this->theme . '/templates'); } /**