NavigationController: Add method getItemLabel()

refs #10246
This commit is contained in:
Johannes Meyer 2015-09-29 17:09:32 +02:00
parent 565704141c
commit 4921b1a62e
1 changed files with 20 additions and 0 deletions

View File

@ -40,6 +40,26 @@ class NavigationController extends Controller
);
}
/**
* Return the label for the given navigation item type
*
* @param string $type
*
* @return string It's $type if no label can be found
*/
protected function getItemLabel($type)
{
if (isset($this->moduleItemTypes[$type]['label'])) {
return $this->moduleItemTypes[$type]['label'];
}
if (isset($this->defaultItemTypes[$type]['label'])) {
return $this->defaultItemTypes[$type]['label'];
}
return $type;
}
/**
* Return a list of available navigation item types
*