From 2ae293b235116bc5817e55919abe456ccbbbad25 Mon Sep 17 00:00:00 2001 From: Felix Kopp Date: Sat, 15 Sep 2012 23:23:07 +0200 Subject: [PATCH 1/1] [BUGFIX] Page module title obeys language overlay MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Makes the page backend module's headline language overlay aware. The displayed headline is the page title of the selected page. But the displayed headline should also consider the selected language. Change-Id: Ie8b3b81139b9618ac5d2331dc86be5e5cad613d5 Resolves: #39106 Releases: 6.1 Reviewed-on: https://review.typo3.org/13598 Reviewed-by: Anja Leichsenring Tested-by: Anja Leichsenring Reviewed-by: Pascal Dürsteler Tested-by: Pascal Dürsteler Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn --- .../Controller/PageLayoutController.php | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php index 8afcf3e79a17..c48d5e75514a 100644 --- a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php +++ b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php @@ -372,6 +372,30 @@ class PageLayoutController { return $content; } + /** + * + * @return string $title + */ + protected function getLocalizedPageTitle() { + if ($this->current_sys_language > 0) { + $overlayRecord = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( + 'title', + 'pages_language_overlay', + 'pid = ' . intval($this->id) . + ' AND sys_language_uid = ' . intval($this->current_sys_language) . + \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages_language_overlay') . + \TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause('pages_language_overlay'), + '', + '', + '', + 'sys_language_uid' + ); + return $overlayRecord['title']; + } else { + return $this->pageinfo['title']; + } + } + /** * Main function. * Creates some general objects and calls other functions for the main rendering of module content. @@ -501,7 +525,7 @@ class PageLayoutController { // Removing duplicates, if any $this->colPosList = implode(',', array_unique(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $this->colPosList))); // Page title - $body = $this->doc->header($this->pageinfo['title']); + $body = $this->doc->header($this->getLocalizedPageTitle()); $body .= $this->getHeaderFlashMessagesForCurrentPid(); // Render the primary module content: if ($this->MOD_SETTINGS['function'] == 0) { @@ -1099,4 +1123,4 @@ class PageLayoutController { } -?> \ No newline at end of file +?> -- 2.20.1