Skip to content

Commit

Permalink
[BUGFIX] Provide page ID in pagetree overview
Browse files Browse the repository at this point in the history
Implement the page ID in pagetree and localization overview. And
make it controllable with User TS Config.

Resolves: #86269
Releases: master
Change-Id: Ie6fc1824aa3ecc781d3386017744c58604fb36e4
Reviewed-on: https://review.typo3.org/58295
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Tested-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Tested-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
brandung-gs authored and lolli42 committed Sep 20, 2018
1 parent 685f7b5 commit 625854d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 7 additions & 4 deletions typo3/sysext/backend/Classes/View/PageLayoutView.php
Expand Up @@ -799,12 +799,12 @@ public function getTable_pages($id)
}
switch ($field) {
case 'title':
$theData[$field] = '&nbsp;' . $eI . '<strong>'
$theData[$field] = $eI . '&nbsp;<strong>'
. $lang->sL($GLOBALS['TCA']['pages']['columns'][$field]['label'])
. '</strong>';
break;
case 'uid':
$theData[$field] = '&nbsp;<strong>ID</strong>';
$theData[$field] = '';
break;
default:
if (strpos($field, 'table_') === 0) {
Expand All @@ -818,7 +818,7 @@ public function getTable_pages($id)
'</span>';
}
} else {
$theData[$field] = '&nbsp;&nbsp;' . $eI . '<strong>'
$theData[$field] = $eI . '&nbsp;<strong>'
. htmlspecialchars($lang->sL($GLOBALS['TCA']['pages']['columns'][$field]['label']))
. '</strong>';
}
Expand Down Expand Up @@ -1765,15 +1765,18 @@ protected function getPageRecordsRecursive(int $pid, int $depth, string $iconPre
*/
public function pages_drawItem($row, $fieldArr)
{
$userTsConfig = $this->getBackendUser()->getTSConfig();

// Initialization
$theIcon = $this->getIcon('pages', $row);
// Preparing and getting the data-array
$theData = [];
foreach ($fieldArr as $field) {
switch ($field) {
case 'title':
$showPageId = !empty($userTsConfig['options.']['pageTree.']['showPageIdWithTitle']);
$pTitle = htmlspecialchars(BackendUtility::getProcessedValue('pages', $field, $row[$field], 20));
$theData[$field] = $row['treeIcons'] . $theIcon . $pTitle;
$theData[$field] = $row['treeIcons'] . $theIcon . ($showPageId ? '[' . $row['uid'] . '] ' : '') . $pTitle;
break;
case 'php_tree_stop':
// Intended fall through
Expand Down
Expand Up @@ -212,17 +212,22 @@ protected function renderL10nTable(&$tree)
$newOL_js = [];
$langRecUids = [];
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);

$userTsConfig = $this->getBackendUser()->getTSConfig();
$showPageId = !empty($userTsConfig['options.']['pageTree.']['showPageIdWithTitle']);

foreach ($tree->tree as $data) {
$tCells = [];
$langRecUids[0][] = $data['row']['uid'];
$pageTitle = ($showPageId ? '[' . (int)$data['row']['uid'] . '] ' : '') . GeneralUtility::fixed_lgd_cs($data['row']['title'], $titleLen);
// Page icons / titles etc.
$tCells[] = '<td' . ($data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '') . '>' .
($data['depthData'] ?: '') .
BackendUtility::wrapClickMenuOnIcon($data['HTML'], 'pages', $data['row']['uid']) .
'<a href="#" onclick="' . htmlspecialchars(
'top.loadEditId(' . (int)$data['row']['uid'] . ',"&SET[language]=0"); return false;'
) . '" title="' . $lang->sL('LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPage') . '">' .
htmlspecialchars(GeneralUtility::fixed_lgd_cs($data['row']['title'], $titleLen)) .
htmlspecialchars($pageTitle) .
'</a>' .
((string)$data['row']['nav_title'] !== '' ? ' [Nav: <em>' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($data['row']['nav_title'], $titleLen)) . '</em>]' : '') .
'</td>';
Expand Down Expand Up @@ -284,7 +289,7 @@ protected function renderL10nTable(&$tree)
$langRecUids[$languageId][] = $row['uid'];
$status = $row['_HIDDEN'] ? (GeneralUtility::hideIfNotTranslated($data['row']['l18n_cfg']) || GeneralUtility::hideIfDefaultLanguage($data['row']['l18n_cfg']) ? 'danger' : '') : 'success';
$icon = $this->iconFactory->getIconForRecord('pages', $row, Icon::SIZE_SMALL)->render();
$info = $icon . htmlspecialchars(
$info = $icon . ($showPageId ? ' [' . (int)$row['uid'] . ']' : '') . ' ' . htmlspecialchars(
GeneralUtility::fixed_lgd_cs($row['title'], $titleLen)
) . ((string)$row['nav_title'] !== '' ? ' [Nav: <em>' . htmlspecialchars(
GeneralUtility::fixed_lgd_cs($row['nav_title'], $titleLen)
Expand Down

0 comments on commit 625854d

Please sign in to comment.