Call onAdminTemplateNavPluginHook to provide plugins the ability to populate plugins_hooked_nav

Example event handling:

    public function onAdminTemplateNavPluginHook()
    {
        $this->grav['twig']->plugins_hooked_nav['PLUGIN_DATA.DATA'] =
['route' => 'data', 'icon' => 'fa-file-text'];
    }
This commit is contained in:
Flavio Copes
2015-09-07 11:48:42 +02:00
parent 921fb71dbc
commit 5658bad347
2 changed files with 12 additions and 0 deletions

View File

@@ -223,6 +223,9 @@ class AdminPlugin extends Plugin
$twig->twig_vars['base_path'] = GRAV_ROOT;
$twig->twig_vars['admin'] = $this->admin;
// Gather Plugin-hooked nav items
$this->grav->fireEvent('onAdminTemplateNavPluginHook');
switch ($this->template) {
case 'dashboard':
$twig->twig_vars['popularity'] = $this->popularity;