';
$t3BeSitenameMd5 = md5('Typo3Backend-' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']);
// History
$link = (string)$uriBuilder->buildUriFromRoute(
'record_history',
[
'element' => 'pages:' . $id,
'returnUrl' => $returnUrl,
]
);
$title = $this->getLabel('edit_recordHistory');
$output[] = '
';
$output[] = ' ' . $iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL)->render();
$output[] = '';
// New Content
if ($perms & Permission::CONTENT_EDIT && $langAllowed) {
$linkParameters = [
'id' => $id,
'returnUrl' => $returnUrl,
];
if (!empty($languageAspect->getId())) {
$linkParameters['sys_language_uid'] = $languageAspect->getId();
}
$link = (string)$uriBuilder->buildUriFromRoute($moduleName, $linkParameters);
$icon = $iconFactory->getIcon('actions-add', Icon::SIZE_SMALL)->render();
$title = $this->getLabel('edit_newContentElement');
$output[] = '
';
$output[] = ' ' . $icon;
$output[] = '';
}
// Move Page
if ($perms & Permission::PAGE_EDIT) {
$link = (string)$uriBuilder->buildUriFromRoute(
'move_element',
[
'table' => 'pages',
'uid' => $id,
'returnUrl' => $returnUrl,
]
);
$icon = $iconFactory->getIcon('actions-document-move', Icon::SIZE_SMALL)->render();
$title = $this->getLabel('edit_move_page');
$output[] = '
';
$output[] = ' ' . $icon;
$output[] = '';
}
// New Page
if ($perms & Permission::PAGE_NEW) {
$link = (string)$uriBuilder->buildUriFromRoute(
'db_new',
[
'id' => $id,
'pagesOnly' => 1,
'returnUrl' => $returnUrl,
]
);
$icon = $iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)->render();
$title = $this->getLabel('edit_newPage');
$output[] = '
';
$output[] = ' ' . $icon;
$output[] = '';
}
// Edit Page
if ($perms & Permission::PAGE_EDIT) {
$link = (string)$uriBuilder->buildUriFromRoute(
'record_edit',
[
'edit[pages][' . $id . ']' => 'edit',
'noView' => 1,
'returnUrl' => $returnUrl,
]
);
$icon = $iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)->render();
$title = $this->getLabel('edit_editPageProperties');
$output[] = '
';
$output[] = ' ' . $icon;
$output[] = '';
}
// Edit Page Overlay
if ($perms & Permission::PAGE_EDIT && $languageAspect->getId() > 0 && $langAllowed) {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('pages');
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
$row = $queryBuilder
->select('uid', 'pid', 't3ver_state')
->from('pages')
->where(
$queryBuilder->expr()->eq(
$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField'],
$queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)
),
$queryBuilder->expr()->eq(
$GLOBALS['TCA']['pages']['ctrl']['languageField'],
$queryBuilder->createNamedParameter($languageAspect->getId(), \PDO::PARAM_INT)
)
)
->setMaxResults(1)
->execute()
->fetch();
// @extensionScannerIgnoreLine At least in v10 this is a false positive
$tsfe->sys_page->versionOL('pages', $row);
if (is_array($row)) {
$link = (string)$uriBuilder->buildUriFromRoute(
'record_edit',
[
'edit[pages][' . $row['uid'] . ']' => 'edit',
'noView' => 1,
'returnUrl' => $returnUrl,
]
);
$icon = $iconFactory->getIcon('mimetypes-x-content-page-language-overlay', Icon::SIZE_SMALL)
->render();
$title = $this->getLabel('edit_editPageOverlay');
$output[] = '
';
$output[] = ' ' . $icon;
$output[] = '';
}
}
// Open list view
if ($this->getBackendUser()->check('modules', 'web_list')) {
$link = (string)$uriBuilder->buildUriFromRoute(
'web_list',
[
'id' => $id,
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'),
]
);
$icon = $iconFactory->getIcon('actions-system-list-open', Icon::SIZE_SMALL)->render();
$title = $this->getLabel('edit_db_list');
$output[] = '
';
$output[] = ' ' . $icon;
$output[] = '';
}
$output[] = '