mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
i18n for CMS section titles (see #7798)
This commit is contained in:
parent
3b592122fd
commit
2fab657fce
@ -336,9 +336,8 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
||||
}
|
||||
|
||||
function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
|
||||
$title = $this->Title();
|
||||
|
||||
$response = parent::handleRequest($request, $model);
|
||||
$title = $this->Title();
|
||||
if(!$response->getHeader('X-Controller')) $response->addHeader('X-Controller', $this->class);
|
||||
if(!$response->getHeader('X-Title')) $response->addHeader('X-Title', $title);
|
||||
|
||||
@ -1342,8 +1341,10 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
||||
* @return string
|
||||
*/
|
||||
function SectionTitle() {
|
||||
if($title = $this->stat('menu_title')) return $title;
|
||||
|
||||
$class = get_class($this);
|
||||
$defaultTitle = LeftAndMain::menu_title_for_class($class);
|
||||
if($title = _t("{$class}.MENUTITLE", $defaultTitle)) return $title;
|
||||
|
||||
foreach($this->MainMenu() as $menuItem) {
|
||||
if($menuItem->LinkingMode != 'link') return $menuItem->Title;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user