mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT Updated LeftAndMain->getMenuTitle() to use classname as fallback if $menu_title is not defined - one less thing to specify in a minimalist ModelAdmin subclass
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@65181 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f2bf599795
commit
6eadbbff7f
@ -254,12 +254,13 @@ class LeftAndMain extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override {@link getMenuTitle} in child classes to make the menu title translatable for that class
|
* Override {@link getMenuTitle} in child classes to make the menu title translatable for that class.
|
||||||
|
* Uses {@link $menu_title} if present, otherwise falls back to the classname without the "Admin" suffix.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getMenuTitle() {
|
public function getMenuTitle() {
|
||||||
return $this->stat('menu_title');
|
return ($this->stat('menu_title')) ? $this->stat('menu_title') : preg_replace('/Admin$/', '', $this->class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($params) {
|
public function show($params) {
|
||||||
|
Loading…
Reference in New Issue
Block a user