1
0
mirror of https://github.com/silverstripe/silverstripe-framework synced 2024-10-22 14:05:37 +02:00

i18n for CMS section titles (see )

This commit is contained in:
Ingo Schommer 2012-08-26 23:13:42 +02:00
parent 3b592122fd
commit 2fab657fce

View File

@ -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;
}