2 declare(strict_types = 1);
56 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.view',
57 'iconIdentifier' =>
'actions-view',
58 'callbackAction' =>
'viewRecord'
61 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.edit',
62 'iconIdentifier' =>
'actions-open',
63 'callbackAction' =>
'editRecord'
66 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.new',
67 'iconIdentifier' =>
'actions-add',
68 'callbackAction' =>
'newRecord'
71 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.info',
72 'iconIdentifier' =>
'actions-document-info',
73 'callbackAction' =>
'openInfoPopUp'
79 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.copy',
80 'iconIdentifier' =>
'actions-edit-copy',
81 'callbackAction' =>
'copy'
84 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.copy',
85 'iconIdentifier' =>
'actions-edit-copy-release',
86 'callbackAction' =>
'clipboardRelease'
89 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.cut',
90 'iconIdentifier' =>
'actions-edit-cut',
91 'callbackAction' =>
'cut'
94 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.cutrelease',
95 'iconIdentifier' =>
'actions-edit-cut-release',
96 'callbackAction' =>
'clipboardRelease'
99 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.pasteafter',
100 'iconIdentifier' =>
'actions-document-paste-after',
101 'callbackAction' =>
'pasteAfter'
108 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.more',
109 'iconIdentifier' =>
'',
110 'callbackAction' =>
'openSubmenu',
113 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:CM_newWizard',
114 'iconIdentifier' =>
'actions-add',
115 'callbackAction' =>
'newContentWizard',
117 'openListModule' => [
118 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:CM_db_list',
119 'iconIdentifier' =>
'actions-system-list-open',
120 'callbackAction' =>
'openListModule',
128 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:enable',
129 'iconIdentifier' =>
'actions-edit-unhide',
130 'callbackAction' =>
'enableRecord',
133 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:disable',
134 'iconIdentifier' =>
'actions-edit-hide',
135 'callbackAction' =>
'disableRecord',
138 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.delete',
139 'iconIdentifier' =>
'actions-edit-delete',
140 'callbackAction' =>
'deleteRecord',
143 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:CM_history',
144 'iconIdentifier' =>
'actions-document-history-open',
145 'callbackAction' =>
'openHistoryPopUp',
156 if (in_array($this->table, [
'sys_file',
'sys_filemounts',
'sys_file_storage',
'pages'],
true)
157 || strpos($this->table,
'-drag') !==
false) {
160 return isset(
$GLOBALS[
'TCA'][$this->table]);
168 parent::initialize();
189 public function addItems(array $items): array
191 if (!empty($items)) {
205 protected function canRender(
string $itemName,
string $type): bool
207 if (in_array($type, [
'divider',
'submenu'],
true)) {
210 if (in_array($itemName, $this->disabledItems,
true)) {
240 case 'openListModule':
268 $this->pagePermissions = $this->backendUser->calcPerms($this->pageRecord);
280 return $this->backendUser->isAdmin() || ($this->pagePermissions & $permission) == $permission;
292 if ($itemName ===
'view') {
295 if ($itemName ===
'enable' || $itemName ===
'disable') {
298 if ($itemName ===
'newWizard' && $this->table ===
'tt_content') {
300 ??
'new_content_element_wizard';
302 'id' => $this->record[
'pid'],
303 'sys_language_uid' => $this->record[
'sys_language_uid'],
304 'colPos' => $this->record[
'colPos'],
305 'uid_pid' => -$this->record[
'uid']
307 $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
308 $url = (string)$uriBuilder->buildUriFromRoute($moduleName, $urlParameters);
310 'data-new-wizard-url' => htmlspecialchars($url),
311 'data-title' => $this->languageService->getLL(
'newContentElement'),
314 if ($itemName ===
'delete') {
317 if ($itemName ===
'openListModule') {
319 'data-page-uid' => $this->record[
'pid']
322 if ($itemName ===
'pasteAfter') {
339 'data-preview-url' => htmlspecialchars($viewLink),
365 $closeText = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel');
366 $okText = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:ok');
369 $selItem = $this->clipboard->getSelectedRecord();
370 $title = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:clip_paste');
372 $confirmMessage = sprintf(
373 $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:mess.'
374 . ($this->clipboard->currentMode() ===
'copy' ?
'copy' :
'move') .
'_' . $type),
375 GeneralUtility::fixed_lgd_cs($selItem[
'_RECORD_TITLE'], $this->backendUser->uc[
'titleLen']),
379 'data-title' => htmlspecialchars($title),
380 'data-message' => htmlspecialchars($confirmMessage),
381 'data-button-close-text' => htmlspecialchars($closeText),
382 'data-button-ok-text' => htmlspecialchars($okText),
395 $closeText = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel');
396 $okText = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete');
401 $title = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:delete');
402 $confirmMessage = sprintf(
403 $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:mess.delete'),
408 $this->record[
'uid'],
409 ' ' . $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.referencesToRecord')
413 $this->record[
'uid'],
414 ' ' . $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.translationsOfRecord')
417 'data-title' => htmlspecialchars($title),
418 'data-message' => htmlspecialchars($confirmMessage),
419 'data-button-close-text' => htmlspecialchars($closeText),
420 'data-button-ok-text' => htmlspecialchars($okText),
433 return (
int)$this->record[
'pid'];
444 $additionalParams =
'';
445 if ($this->table ===
'tt_content') {
446 $anchorSection =
'#c' . $this->record[
'uid'];
447 $language = (int)$this->record[
$GLOBALS[
'TCA'][
'tt_content'][
'ctrl'][
'languageField']];
449 $additionalParams =
'&L=' . $language;
480 $userTsConfig = $this->backendUser->getTSConfig();
481 return (
bool)trim($userTsConfig[
'options.'][
'showHistory.'][$this->table] ?? $userTsConfig[
'options.'][
'showHistory'] ??
'1');
491 return $this->table ===
'tt_content';
501 if (isset(
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'readOnly']) &&
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'readOnly']) {
504 if ($this->backendUser->isAdmin()) {
507 if (isset(
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'adminOnly']) &&
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'adminOnly']) {
512 && $this->backendUser->check(
'tables_modify', $this->table)
514 && $this->backendUser->recordEditAccessInternals($this->table, $this->record);
526 $this->backendUser->getTSConfig()[
'options.'][
'disableDelete.'][$this->table]
527 ?? $this->backendUser->getTSConfig()[
'options.'][
'disableDelete']
569 return $this->table ===
'tt_content'
579 return $this->backendUser->check(
'modules',
'web_list');
608 $clipboardElementCount = count($this->clipboard->elFromTable($this->table));
610 return $clipboardElementCount
611 && $this->backendUser->check(
'tables_modify', $this->table)
624 if (isset(
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'enablecolumns'][
'disabled'])) {
627 $hiddenFieldName !==
'' && !empty(
$GLOBALS[
'TCA'][$this->table][
'columns'][$hiddenFieldName])
629 empty(
$GLOBALS[
'TCA'][$this->table][
'columns'][$hiddenFieldName][
'exclude'])
630 || $this->backendUser->check(
'non_exclude_fields', $this->table .
':' . $hiddenFieldName)
633 return (
int)$this->record[$hiddenFieldName] === (int)$value;
646 return (
int)$this->pageRecord[
'editlock'] === 1
647 || isset(
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'editlock'])
648 && (int)$this->record[
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'editlock']] === 1;
658 if (!isset($this->record[
't3ver_state'])) {
673 if ($this->clipboard->current ===
'normal') {
674 $isSelected = $this->clipboard->isSelected($this->table, $this->record[
'uid']);
676 return $mode ===
'' ? !empty($isSelected) : $isSelected === $mode;
694 return $this->record[
'uid'];