Module.php: Allow modules to provide configurable navigation items

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-07 11:06:11 +02:00
parent a1b219f97d
commit 1be6dc0553
1 changed files with 31 additions and 0 deletions

View File

@ -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
*
@ -875,6 +882,17 @@ class Module
return $this->userGroupBackends;
}
/**
* Return this module's configurable navigation items
*
* @return array
*/
public function getNavigationItems()
{
$this->launchConfigScript();
return $this->navigationItems;
}
/**
* Provide a named permission
*
@ -979,6 +997,19 @@ class Module
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
*