[BUGFIX] Page module title obeys language overlay 98/13598/7
authorFelix Kopp <felix-source@phorax.com>
Sat, 15 Sep 2012 21:23:07 +0000 (23:23 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 5 Apr 2013 19:28:59 +0000 (21:28 +0200)
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
typo3/sysext/backend/Classes/Controller/PageLayoutController.php

index 8afcf3e..c48d5e7 100644 (file)
@@ -373,6 +373,30 @@ class PageLayoutController {
        }
 
        /**
+        *
+        * @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
+?>