Project

General

Profile

Feature #73665 ยป pagetree_patch.diff

Sonja Schubert, 2016-02-25 10:41

View differences:

typo3_src-7.6.2-pagetree/typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php 2016-01-27 11:18:33.000000000 +0100
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
......
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
......
{
$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');
......
$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 {
    (1-1/1)