From 2fab657fcee6f697de428c4810960222e6eb7677 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 26 Aug 2012 23:13:42 +0200 Subject: [PATCH] i18n for CMS section titles (see #7798) --- admin/code/LeftAndMain.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index e96b1c665..e789450cc 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -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; }