2 declare(strict_types = 1);
40 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.edit',
41 'iconIdentifier' =>
'actions-page-open',
42 'callbackAction' =>
'editFile'
45 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.rename',
46 'iconIdentifier' =>
'actions-edit-rename',
47 'callbackAction' =>
'renameFile'
50 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.upload',
51 'iconIdentifier' =>
'actions-edit-upload',
52 'callbackAction' =>
'uploadFile'
55 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.new',
56 'iconIdentifier' =>
'actions-document-new',
57 'callbackAction' =>
'createFile'
60 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.info',
61 'iconIdentifier' =>
'actions-document-info',
62 'callbackAction' =>
'openInfoPopUp'
68 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.copy',
69 'iconIdentifier' =>
'actions-edit-copy',
70 'callbackAction' =>
'copyFile'
73 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.copy',
74 'iconIdentifier' =>
'actions-edit-copy-release',
75 'callbackAction' =>
'copyReleaseFile'
78 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.cut',
79 'iconIdentifier' =>
'actions-edit-cut',
80 'callbackAction' =>
'cutFile'
83 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.cutrelease',
84 'iconIdentifier' =>
'actions-edit-cut-release',
85 'callbackAction' =>
'cutReleaseFile'
88 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.pasteinto',
89 'iconIdentifier' =>
'actions-document-paste-into',
90 'callbackAction' =>
'pasteFileInto'
96 'label' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.delete',
97 'iconIdentifier' =>
'actions-edit-delete',
98 'callbackAction' =>
'deleteFile'
107 return $this->table ===
'sys_file';
115 parent::initialize();
118 $this->record = $fileObject;
128 protected function canRender(
string $itemName,
string $type):
bool
130 if (in_array($type, [
'divider',
'submenu'],
true)) {
133 if (in_array($itemName, $this->disabledItems,
true)) {
184 && $this->record->checkActionPermission(
'write')
185 && GeneralUtility::inList(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'textfile_ext'], $this->record->getExtension());
193 return $this->record->checkActionPermission(
'rename');
201 return $this->record->checkActionPermission(
'delete');
217 return $this->
isFolder() && $this->record->checkActionPermission(
'write');
225 return $this->record->checkActionPermission(
'read') && $this->record->checkActionPermission(
'copy') && !$this->
isRecordInClipboard(
'copy');
241 $elArr = $this->clipboard->elFromTable(
'_FILE');
245 $selItem = reset($elArr);
249 && $this->record->checkActionPermission(
'write')
251 !$fileOrFolderInClipBoard instanceof
Folder
266 return (!$fileOrFolderInClipBoard instanceof
Folder)
268 $this->record->getStorage()->getRootLevelFolder()->getCombinedIdentifier()
269 == $fileOrFolderInClipBoard->getStorage()->getRootLevelFolder()->getCombinedIdentifier()
281 if ($mode !==
'' && !$this->record->checkActionPermission($mode)) {
287 $uid = GeneralUtility::shortMD5($this->record->getCombinedIdentifier());
288 if ($this->clipboard->current ===
'normal') {
289 $isSelected = $this->clipboard->isSelected(
$table, $uid);
291 return $mode ===
'' ? !empty($isSelected) : $isSelected === $mode;
299 return $this->record->getIdentifier() === $this->record->getStorage()->getRootLevelFolder()->getIdentifier();
305 protected function isFile():
bool
307 return $this->record instanceof
File;
315 return $this->record instanceof
Folder;
325 'data-callback-module' =>
'TYPO3/CMS/Filelist/ContextMenuActions'
328 $recordTitle = GeneralUtility::fixed_lgd_cs($this->record->getName(), $this->backendUser->uc[
'titleLen']);
330 $title = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:delete');
331 $confirmMessage = sprintf(
332 $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:mess.delete'),
338 $this->record->getIdentifier(),
339 ' ' . $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.referencesToFolder')
344 $this->record->getUid(),
345 ' ' . $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.referencesToFile')
348 $closeText = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:button.cancel');
349 $deleteText = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:button.delete');
351 'data-title' => htmlspecialchars($title),
352 'data-message' => htmlspecialchars($confirmMessage),
353 'data-button-close-text' => htmlspecialchars($closeText),
354 'data-button-ok-text' => htmlspecialchars($deleteText),
358 $elArr = $this->clipboard->elFromTable(
'_FILE');
359 $selItem = reset($elArr);
362 $title = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:clip_paste');
364 $confirmMessage = sprintf(
365 $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:mess.'
366 . ($this->clipboard->currentMode() ===
'copy' ?
'copy' :
'move') .
'_into'),
367 $fileOrFolderInClipBoard->getName(),
368 $this->record->getName()
370 $closeText = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:button.cancel');
371 $okLabel = $this->clipboard->currentMode() ===
'copy' ?
'copy' :
'pasteinto';
372 $okText = $this->languageService->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.' . $okLabel);
374 'data-title' => htmlspecialchars($title),
375 'data-message' => htmlspecialchars($confirmMessage),
376 'data-button-close-text' => htmlspecialchars($closeText),
377 'data-button-ok-text' => htmlspecialchars($okText),
389 return $this->record->getCombinedIdentifier();