Skip to content

Commit

Permalink
[BUGFIX] Show page flag/title in language, show element uid
Browse files Browse the repository at this point in the history
This fixes the output for flag/title of translated pages and the uid of
every element as tooltip on the menu icon as this is done by core page
layout module.

Resolves: #199
  • Loading branch information
Alexander Opitz committed Aug 20, 2018
1 parent 4942452 commit 0d85dba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions Classes/Controller/BackendLayoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ public function main()
} else {
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
}
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/Tooltip');

// Set up JS for dynamic tab menu and side bar
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/Tabs');
Expand Down Expand Up @@ -1321,7 +1322,9 @@ public function render_framework_singleSheet($contentTreeArr, $languageKey, $she
$elementClass .= ' tpm-container-element-depth-' . $contentTreeArr['depth'];
$elementClass .= ' tpm-container-element-depth-' . ($contentTreeArr['depth'] % 2 ? 'odd' : 'even');

$recordIcon = $contentTreeArr['el']['iconTag'];
$recordIcon = '<span ' . BackendUtility::getRecordToolTip($contentTreeArr['el'], $contentTreeArr['el']['table']) . '>'
. $contentTreeArr['el']['iconTag']
. '</span>';

$menuCommands = array();
if (TemplaVoilaUtility::getBackendUser()->isPSet($calcPerms, 'pages', 'new')) {
Expand All @@ -1347,6 +1350,13 @@ public function render_framework_singleSheet($contentTreeArr, $languageKey, $she
case 'pages':
$elementTitlebarClass = 't3-page-column-header';
$elementClass .= ' pagecontainer';
$languageUid = $this->currentLanguageUid;
if ($this->currentLanguageUid !== 0) {
$row = BackendUtility::getRecordLocalization($contentTreeArr['el']['table'], $contentTreeArr['el']['uid'], $this->currentLanguageUid);
if ($row) {
$contentTreeArr['el']['fullTitle'] = BackendUtility::getRecordTitle('pages', $row[0]);
}
}
break;

case 'tt_content':
Expand Down Expand Up @@ -1412,7 +1422,7 @@ public function render_framework_singleSheet($contentTreeArr, $languageKey, $she
}

// Prepare the language icon:
$languageLabel = htmlspecialchars($this->allAvailableLanguages[$contentTreeArr['el']['sys_language_uid']]['title']);
$languageLabel = htmlspecialchars($this->allAvailableLanguages[$languageUid]['title']);
if ($this->allAvailableLanguages[$languageUid]['flagIcon']) {
$languageIcon = \Ppi\TemplaVoilaPlus\Utility\IconUtility::getFlagIconForLanguage(
$this->allAvailableLanguages[$languageUid]['flagIcon'],
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/ApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ public function getContentTree_element($table, $row, &$tt_content_elementRegiste
'fullTitle' => BackendUtility::getRecordTitle($table, $row),
'icon' => '', // kept because it's not clear if this is used elsewhere
'iconTag' => $this->iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL)->render(),
'sys_language_uid' => $row['sys_language_uid'],
'sys_language_uid' => (int) $row['sys_language_uid'],
'l18n_parent' => $row['l18n_parent'],
'CType' => $row['CType'],
'layout' => $row['layout'],
Expand Down

0 comments on commit 0d85dba

Please sign in to comment.