diff -ru typo3_src-7.6.2/typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php typo3_src-7.6.2-pagetree/typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php --- typo3_src-7.6.2/typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php 2016-01-27 10:04:44.000000000 +0100 +++ typo3_src-7.6.2-pagetree/typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php 2016-01-27 11:18:33.000000000 +0100 @@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Versioning\VersionState; +use TYPO3\CMS\Core\Utility\DebugUtility; /** * Page Tree and Context Menu Commands @@ -52,6 +53,16 @@ protected static $titleLength = null; /** + * @var int|null + */ + protected static $showLocalizedTitle = null; + + /** + * @var string + */ + protected static $showLocalizedTitleDefaultLabel = 'Default:'; + + /** * Visibly the page * * @param \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode $node @@ -305,6 +316,10 @@ { $iconFactory = GeneralUtility::makeInstance(IconFactory::class); if (self::$titleLength === null) { + self::$showLocalizedTitle = (int)$GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showLocalizedTitle'); + if ($GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showLocalizedTitleDefaultLabel') != '') { + self::$showLocalizedTitleDefaultLabel = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showLocalizedTitleDefaultLabel'); + } self::$useNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle'); self::$addIdAsPrefix = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPageIdWithTitle'); self::$addDomainName = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showDomainNameWithTitle'); @@ -321,12 +336,25 @@ $subNode->setMountPoint($mountPoint); $subNode->setWorkspaceId($record['_ORIG_uid'] ?: $record['uid']); $subNode->setBackgroundColor(self::$backgroundColors[$record['uid']]); - $field = 'title'; - $text = $record['title']; + if (self::$useNavTitle && trim($record['nav_title']) !== '') { $field = 'nav_title'; - $text = $record['nav_title']; + } else { + $field = 'title'; } + + if (self::$showLocalizedTitle !== null && self::$showLocalizedTitle !== 0 && $record['uid'] !== 0) { + $pageOverlayRecordRow = BackendUtility::getRecordRaw('pages_language_overlay', ' pid = '.$record['uid'].' AND deleted = 0 AND sys_language_uid = '.intval(self::$showLocalizedTitle), 'uid'); + if (is_array($pageOverlayRecordRow)) { + $pageOverlayWSOLRow = BackendUtility::getRecordWSOL('pages_language_overlay', $pageOverlayRecordRow['uid']); + $text = $pageOverlayWSOLRow[$field]; + } else { + $text = self::$showLocalizedTitleDefaultLabel.$record[$field]; + } + } else { + $text = $record[$field]; + } + if (trim($text) === '') { $visibleText = '[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', true) . ']'; } else {