diff --git a/typo3/sysext/backend/Classes/Controller/RecordListController.php b/typo3/sysext/backend/Classes/Controller/RecordListController.php index e3621b2869efdbfa1921427d62e511a786d36c6b..97ffd2692134293c8d8b3809ec460f84361f4e01 100644 --- a/typo3/sysext/backend/Classes/Controller/RecordListController.php +++ b/typo3/sysext/backend/Classes/Controller/RecordListController.php @@ -114,11 +114,13 @@ class RecordListController // Check if Clipboard is allowed to be shown: if (($this->modTSconfig['enableClipBoard'] ?? '') === 'activated') { - $this->allowClipboard = true; + $this->allowClipboard = false; + $this->moduleData->set('clipBoard', true); } elseif (($this->modTSconfig['enableClipBoard'] ?? '') === 'selectable') { $this->allowClipboard = true; } elseif (($this->modTSconfig['enableClipBoard'] ?? '') === 'deactivated') { $this->allowClipboard = false; + $this->moduleData->set('clipBoard', false); } // Check if SearchBox is allowed to be shown: @@ -155,7 +157,7 @@ class RecordListController $typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class); $dbList->setTableDisplayOrder($typoScriptService->convertTypoScriptArrayToPlainArray($this->modTSconfig['tableDisplayOrder.'])); } - $clipboard = $this->initializeClipboard($request, $this->allowClipboard && (bool)$this->moduleData->get('clipBoard')); + $clipboard = $this->initializeClipboard($request, (bool)$this->moduleData->get('clipBoard')); $dbList->clipObj = $clipboard; $additionalRecordListEvent = $this->eventDispatcher->dispatch(new RenderAdditionalContentToRecordListEvent($request)); @@ -191,7 +193,7 @@ class RecordListController $searchBoxHtml = $this->renderSearchBox($request, $dbList, $this->searchTerm, $search_levels); } $clipboardHtml = ''; - if ($this->allowClipboard && $this->moduleData->get('clipBoard') && ($tableListHtml || $clipboard->hasElements())) { + if ($this->moduleData->get('clipBoard') && ($tableListHtml || $clipboard->hasElements())) { $clipboardHtml = '<hr class="spacer"><typo3-backend-clipboard-panel return-url="' . htmlspecialchars($dbList->listURL()) . '"></typo3-backend-clipboard-panel>'; } diff --git a/typo3/sysext/filelist/Classes/Controller/FileListController.php b/typo3/sysext/filelist/Classes/Controller/FileListController.php index fecad02a247f6023b3c72b0536d0fd7708ddb942..45d53d64974e2efb0bfc6d39ae2880a4a350a832 100644 --- a/typo3/sysext/filelist/Classes/Controller/FileListController.php +++ b/typo3/sysext/filelist/Classes/Controller/FileListController.php @@ -74,6 +74,7 @@ class FileListController implements LoggerAwareInterface protected string $cmd = ''; protected string $searchTerm = ''; protected int $currentPage = 1; + protected bool $allowClipboard = true; protected ?Folder $folderObject = null; protected ?DuplicationBehavior $overwriteExistingFiles = null; @@ -290,8 +291,12 @@ class FileListController implements LoggerAwareInterface // Set predefined value for Clipboard: if (($userTsConfig['options.']['file_list.']['enableClipBoard'] ?? '') === 'activated') { $this->moduleData->set('clipBoard', true); + $this->allowClipboard = false; + } elseif (($userTsConfig['options.']['file_list.']['enableClipBoard'] ?? '') === 'selectable') { + $this->allowClipboard = true; } elseif (($userTsConfig['options.']['file_list.']['enableClipBoard'] ?? '') === 'deactivated') { $this->moduleData->set('clipBoard', false); + $this->allowClipboard = false; } } @@ -450,9 +455,10 @@ class FileListController implements LoggerAwareInterface { $lang = $this->getLanguageService(); $userTsConfig = $this->getBackendUser()->getTSConfig(); + $enableClipBoard = ($userTsConfig['options.']['file_list.']['enableClipBoard'] ?? ''); $this->view->assign('enableClipBoard', [ - 'enabled' => ($userTsConfig['options.']['file_list.']['enableClipBoard'] ?? '') === 'selectable', + 'enabled' => $enableClipBoard === 'activated' || $enableClipBoard === 'selectable', 'label' => htmlspecialchars($lang->sL('LLL:EXT:filelist/Resources/Private/Language/locallang_mod_file_list.xlf:clipBoard')), 'mode' => $this->filelist->clipObj->current, ]); @@ -493,11 +499,13 @@ class FileListController implements LoggerAwareInterface ->setLabel($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.view.showThumbnails')) ->setIcon($this->iconFactory->getIcon('actions-image')); } - $viewModeItems[] = GeneralUtility::makeInstance(DropDownToggle::class) - ->setActive((bool)$this->moduleData->get('clipBoard')) - ->setHref($this->filelist->createModuleUri(['clipBoard' => $this->moduleData->get('clipBoard') ? 0 : 1])) - ->setLabel($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.view.showClipboard')) - ->setIcon($this->iconFactory->getIcon('actions-clipboard')); + if ($this->allowClipboard) { + $viewModeItems[] = GeneralUtility::makeInstance(DropDownToggle::class) + ->setActive((bool)$this->moduleData->get('clipBoard')) + ->setHref($this->filelist->createModuleUri(['clipBoard' => $this->moduleData->get('clipBoard') ? 0 : 1])) + ->setLabel($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.view.showClipboard')) + ->setIcon($this->iconFactory->getIcon('actions-clipboard')); + } if (($this->getBackendUser()->getTSConfig()['options.']['file_list.']['displayColumnSelector'] ?? true) && $this->moduleData->get('viewMode') === ViewMode::LIST->value) { $viewModeItems[] = GeneralUtility::makeInstance(DropDownDivider::class);