Skip to content

Commit

Permalink
Module.php: Allow modules to provide configurable navigation items
Browse files Browse the repository at this point in the history
refs #5600
  • Loading branch information
Johannes Meyer committed Sep 7, 2015
1 parent a1b219f commit 1be6dc0
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions library/Icinga/Application/Modules/Module.php
Expand Up @@ -221,6 +221,13 @@ class Module
*/
protected $userGroupBackends = array();

/**
* This module's configurable navigation items
*
* @var array
*/
protected $navigationItems = array();

/**
* Create a new module object
*
Expand Down Expand Up @@ -875,6 +882,17 @@ public function getUserGroupBackends()
return $this->userGroupBackends;
}

/**
* Return this module's configurable navigation items
*
* @return array
*/
public function getNavigationItems()
{
$this->launchConfigScript();
return $this->navigationItems;
}

/**
* Provide a named permission
*
Expand Down Expand Up @@ -979,6 +997,19 @@ protected function provideUserGroupBackend($identifier, $className)
return $this;
}

/**
* Provide a new type of configurable navigation item
*
* @param string $type
*
* @return $this
*/
protected function provideNavigationItem($type)
{
$this->navigationItems[] = $type;
return $this;
}

/**
* Register module namespaces on our class loader
*
Expand Down

0 comments on commit 1be6dc0

Please sign in to comment.