Module.php: Allow modules to provide configurable navigation items
refs #5600
This commit is contained in:
parent
a1b219f97d
commit
1be6dc0553
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue