2 namespace TYPO3\CMS\Filelist\Controller
;
5 * This file is part of the TYPO3 CMS project.
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
14 * The TYPO3 project - inspiring people to share!
17 use TYPO3\CMS\Backend\Clipboard\Clipboard
;
18 use TYPO3\CMS\Backend\Template\Components\ButtonBar
;
19 use TYPO3\CMS\Backend\Template\DocumentTemplate
;
20 use TYPO3\CMS\Backend\Utility\BackendUtility
;
21 use TYPO3\CMS\Backend\View\BackendTemplateView
;
22 use TYPO3\CMS\Core\Imaging\Icon
;
23 use TYPO3\CMS\Core\Imaging\IconFactory
;
24 use TYPO3\CMS\Core\Messaging\FlashMessage
;
25 use TYPO3\CMS\Core\
Resource\DuplicationBehavior
;
26 use TYPO3\CMS\Core\
Resource\Exception
;
27 use TYPO3\CMS\Core\
Resource\Folder
;
28 use TYPO3\CMS\Core\
Resource\ResourceFactory
;
29 use TYPO3\CMS\Core\
Resource\Utility\ListUtility
;
30 use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation
;
31 use TYPO3\CMS\Core\Utility\File\ExtendedFileUtility
;
32 use TYPO3\CMS\Core\Utility\GeneralUtility
;
33 use TYPO3\CMS\Core\Utility\MathUtility
;
34 use TYPO3\CMS\Extbase\Mvc\Controller\ActionController
;
35 use TYPO3\CMS\Extbase\Mvc\View\ViewInterface
;
36 use TYPO3\CMS\Extbase\Utility\LocalizationUtility
;
37 use TYPO3\CMS\Filelist\Configuration\ThumbnailConfiguration
;
38 use TYPO3\CMS\Filelist\FileList
;
41 * Script Class for creating the list of files in the File > Filelist module
43 class FileListController
extends ActionController
48 public $MOD_MENU = [];
53 public $MOD_SETTINGS = [];
56 * Document template object
58 * @var DocumentTemplate
63 * "id" -> the path to list.
72 protected $folderObject;
77 protected $errorMessage;
105 * Defines behaviour when uploading files with names that already exist; possible values are
106 * the values of the \TYPO3\CMS\Core\Resource\DuplicationBehavior enumeration
108 * @var \TYPO3\CMS\Core\Resource\DuplicationBehavior
110 protected $overwriteExistingFiles;
113 * The filelist object
117 public $filelist = null;
120 * The name of the module
124 protected $moduleName = 'file_list';
127 * @var \TYPO3\CMS\Core\Resource\FileRepository
129 protected $fileRepository;
132 * @var BackendTemplateView
137 * BackendTemplateView Container
139 * @var BackendTemplateView
141 protected $defaultViewObjectName = BackendTemplateView
::class;
144 * @param \TYPO3\CMS\Core\Resource\FileRepository $fileRepository
146 public function injectFileRepository(\TYPO3\CMS\Core\
Resource\FileRepository
$fileRepository)
148 $this->fileRepository
= $fileRepository;
152 * Initialize variables, file object
153 * Incoming GET vars include id, pointer, table, imagemode
155 * @throws \RuntimeException
156 * @throws Exception\InsufficientFolderAccessPermissionsException
158 public function initializeObject()
160 $this->doc
= GeneralUtility
::makeInstance(DocumentTemplate
::class);
161 $this->getLanguageService()->includeLLFile('EXT:filelist/Resources/Private/Language/locallang_mod_file_list.xlf');
162 $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_misc.xlf');
165 $this->id
= ($combinedIdentifier = GeneralUtility
::_GP('id'));
166 $this->pointer
= GeneralUtility
::_GP('pointer');
167 $this->table
= GeneralUtility
::_GP('table');
168 $this->imagemode
= GeneralUtility
::_GP('imagemode');
169 $this->cmd
= GeneralUtility
::_GP('cmd');
170 $this->overwriteExistingFiles
= DuplicationBehavior
::cast(GeneralUtility
::_GP('overwriteExistingFiles'));
173 if ($combinedIdentifier) {
174 /** @var $resourceFactory ResourceFactory */
175 $resourceFactory = GeneralUtility
::makeInstance(ResourceFactory
::class);
176 $storage = $resourceFactory->getStorageObjectFromCombinedIdentifier($combinedIdentifier);
177 $identifier = substr($combinedIdentifier, strpos($combinedIdentifier, ':') +
1);
178 if (!$storage->hasFolder($identifier)) {
179 $identifier = $storage->getFolderIdentifierFromFileIdentifier($identifier);
182 $this->folderObject
= $resourceFactory->getFolderObjectFromCombinedIdentifier($storage->getUid() . ':' . $identifier);
183 // Disallow access to fallback storage 0
184 if ($storage->getUid() === 0) {
185 throw new Exception\
InsufficientFolderAccessPermissionsException(
186 'You are not allowed to access files outside your storages',
190 // Disallow the rendering of the processing folder (e.g. could be called manually)
191 if ($this->folderObject
&& $storage->isProcessingFolder($this->folderObject
)) {
192 $this->folderObject
= $storage->getRootLevelFolder();
195 // Take the first object of the first storage
196 $fileStorages = $this->getBackendUser()->getFileStorages();
197 $fileStorage = reset($fileStorages);
199 $this->folderObject
= $fileStorage->getRootLevelFolder();
201 throw new \
RuntimeException('Could not find any folder to be displayed.', 1349276894);
205 if ($this->folderObject
&& !$this->folderObject
->getStorage()->isWithinFileMountBoundaries($this->folderObject
)) {
206 throw new \
RuntimeException('Folder not accessible.', 1430409089);
208 } catch (Exception\InsufficientFolderAccessPermissionsException
$permissionException) {
209 $this->folderObject
= null;
210 $this->errorMessage
= GeneralUtility
::makeInstance(
213 $this->getLanguageService()->getLL('missingFolderPermissionsMessage'),
216 $this->getLanguageService()->getLL('missingFolderPermissionsTitle'),
219 } catch (Exception
$fileException) {
220 // Set folder object to null and throw a message later on
221 $this->folderObject
= null;
222 // Take the first object of the first storage
223 $fileStorages = $this->getBackendUser()->getFileStorages();
224 $fileStorage = reset($fileStorages);
225 if ($fileStorage instanceof \TYPO3\CMS\Core\
Resource\ResourceStorage
) {
226 $this->folderObject
= $fileStorage->getRootLevelFolder();
227 if (!$fileStorage->isWithinFileMountBoundaries($this->folderObject
)) {
228 $this->folderObject
= null;
231 $this->errorMessage
= GeneralUtility
::makeInstance(
234 $this->getLanguageService()->getLL('folderNotFoundMessage'),
237 $this->getLanguageService()->getLL('folderNotFoundTitle'),
240 } catch (\RuntimeException
$e) {
241 $this->folderObject
= null;
242 $this->errorMessage
= GeneralUtility
::makeInstance(
244 $e->getMessage() . ' (' . $e->getCode() . ')',
245 $this->getLanguageService()->getLL('folderNotFoundTitle'),
250 if ($this->folderObject
&& !$this->folderObject
->getStorage()->checkFolderActionPermission(
255 $this->folderObject
= null;
258 // Configure the "menu" - which is used internally to save the values of sorting, displayThumbs etc.
263 * Setting the menu/session variables
265 public function menuConfig()
268 // If array, then it's a selector box menu
269 // If empty string it's just a variable, that will be saved.
270 // Values NOT in this array will not be saved in the settings-array for the module.
274 'displayThumbs' => '',
276 'bigControlPanel' => ''
279 $this->MOD_SETTINGS
= BackendUtility
::getModuleData(
281 GeneralUtility
::_GP('SET'),
287 * Initialize the view
289 * @param ViewInterface $view The view
291 public function initializeView(ViewInterface
$view)
293 /** @var BackendTemplateView $view */
294 parent
::initializeView($view);
295 $pageRenderer = $this->view
->getModuleTemplate()->getPageRenderer();
296 $pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileListLocalisation');
297 $pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileSearch');
298 $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
299 $this->registerDocHeaderButtons();
304 public function initializeIndexAction()
306 // Apply predefined values for hidden checkboxes
307 // Set predefined value for DisplayBigControlPanel:
308 $backendUser = $this->getBackendUser();
309 if ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'activated') {
310 $this->MOD_SETTINGS
['bigControlPanel'] = true;
311 } elseif ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'deactivated') {
312 $this->MOD_SETTINGS
['bigControlPanel'] = false;
314 // Set predefined value for DisplayThumbnails:
315 if ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'activated') {
316 $this->MOD_SETTINGS
['displayThumbs'] = true;
317 } elseif ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'deactivated') {
318 $this->MOD_SETTINGS
['displayThumbs'] = false;
320 // Set predefined value for Clipboard:
321 if ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'activated') {
322 $this->MOD_SETTINGS
['clipBoard'] = true;
323 } elseif ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'deactivated') {
324 $this->MOD_SETTINGS
['clipBoard'] = false;
326 // If user never opened the list module, set the value for displayThumbs
327 if (!isset($this->MOD_SETTINGS
['displayThumbs'])) {
328 $this->MOD_SETTINGS
['displayThumbs'] = $backendUser->uc
['thumbnailsByDefault'];
330 if (!isset($this->MOD_SETTINGS
['sort'])) {
331 // Set default sorting
332 $this->MOD_SETTINGS
['sort'] = 'file';
333 $this->MOD_SETTINGS
['reverse'] = 0;
339 public function indexAction()
341 $pageRenderer = $this->view
->getModuleTemplate()->getPageRenderer();
342 $pageRenderer->setTitle($this->getLanguageService()->getLL('files'));
344 // There there was access to this file path, continue, make the list
345 if ($this->folderObject
) {
346 // Create fileListing object
347 $this->filelist
= GeneralUtility
::makeInstance(FileList
::class, $this);
348 $this->filelist
->thumbs
= $GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && $this->MOD_SETTINGS
['displayThumbs'];
349 // Create clipboard object and initialize that
350 $this->filelist
->clipObj
= GeneralUtility
::makeInstance(Clipboard
::class);
351 $this->filelist
->clipObj
->fileMode
= 1;
352 $this->filelist
->clipObj
->initializeClipboard();
353 $CB = GeneralUtility
::_GET('CB');
354 if ($this->cmd
=== 'setCB') {
355 $CB['el'] = $this->filelist
->clipObj
->cleanUpCBC(array_merge(
356 GeneralUtility
::_POST('CBH'),
357 (array)GeneralUtility
::_POST('CBC')
360 if (!$this->MOD_SETTINGS
['clipBoard']) {
361 $CB['setP'] = 'normal';
363 $this->filelist
->clipObj
->setCmd($CB);
364 $this->filelist
->clipObj
->cleanCurrent();
366 $this->filelist
->clipObj
->endClipboard();
367 // If the "cmd" was to delete files from the list (clipboard thing), do that:
368 if ($this->cmd
=== 'delete') {
369 $items = $this->filelist
->clipObj
->cleanUpCBC(GeneralUtility
::_POST('CBC'), '_FILE', 1);
370 if (!empty($items)) {
371 // Make command array:
373 foreach ($items as $v) {
374 $FILE['delete'][] = ['data' => $v];
376 // Init file processing object for deleting and pass the cmd array.
377 /** @var ExtendedFileUtility $fileProcessor */
378 $fileProcessor = GeneralUtility
::makeInstance(ExtendedFileUtility
::class);
379 $fileProcessor->setActionPermissions();
380 $fileProcessor->setExistingFilesConflictMode($this->overwriteExistingFiles
);
381 $fileProcessor->start($FILE);
382 $fileProcessor->processData();
385 // Start up filelisting object, include settings.
386 $this->pointer
= MathUtility
::forceIntegerInRange($this->pointer
, 0, 100000);
387 $this->filelist
->start(
390 $this->MOD_SETTINGS
['sort'],
391 $this->MOD_SETTINGS
['reverse'],
392 $this->MOD_SETTINGS
['clipBoard'],
393 $this->MOD_SETTINGS
['bigControlPanel']
396 $this->filelist
->generateList();
397 // Set top JavaScript:
398 $this->view
->getModuleTemplate()->addJavaScriptCode(
400 'if (top.fsMod) top.fsMod.recentIds["file"] = "' . rawurlencode($this->id
) . '";' . $this->filelist
->CBfunctions() . '
401 function jumpToUrl(URL) {
402 window.location.href = URL;
407 $pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileDelete');
408 $pageRenderer->addInlineLanguageLabelFile('EXT:lang/Resources/Private/Language/locallang_alt_doc.xlf', 'buttons');
410 // Include DragUploader only if we have write access
411 if ($this->folderObject
->getStorage()->checkUserActionPermission('add', 'File')
412 && $this->folderObject
->checkActionPermission('write')
414 $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DragUploader');
415 $pageRenderer->addInlineLanguageLabelFile('EXT:lang/Resources/Private/Language/locallang_core.xlf', 'file_upload');
416 $pageRenderer->addInlineLanguageLabelArray([
417 'permissions.read' => $this->getLanguageService()->getLL('read'),
418 'permissions.write' => $this->getLanguageService()->getLL('write'),
422 // Setting up the buttons
423 $this->registerButtons();
426 '_additional_info' => $this->filelist
->getFolderInfo(),
427 'combined_identifier' => $this->folderObject
->getCombinedIdentifier(),
429 $this->view
->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord);
431 $this->view
->assign('headline', $this->getModuleHeadline());
432 $this->view
->assign('listHtml', $this->filelist
->HTMLcode
);
434 $this->view
->assign('checkboxes', [
435 'bigControlPanel' => [
436 'enabled' => $this->getBackendUser()->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'selectable',
437 'label' => htmlspecialchars($this->getLanguageService()->getLL('bigControlPanel')),
438 'html' => BackendUtility
::getFuncCheck(
440 'SET[bigControlPanel]',
441 $this->MOD_SETTINGS
['bigControlPanel'] ??
'',
444 'id="bigControlPanel"'
448 'enabled' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && $this->getBackendUser()->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'selectable',
449 'label' => htmlspecialchars($this->getLanguageService()->getLL('displayThumbs')),
450 'html' => BackendUtility
::getFuncCheck(
452 'SET[displayThumbs]',
453 $this->MOD_SETTINGS
['displayThumbs'] ??
'',
456 'id="checkDisplayThumbs"'
459 'enableClipBoard' => [
460 'enabled' => $this->getBackendUser()->getTSConfigVal('options.file_list.enableClipBoard') === 'selectable',
461 'label' => htmlspecialchars($this->getLanguageService()->getLL('clipBoard')),
462 'html' => BackendUtility
::getFuncCheck(
465 $this->MOD_SETTINGS
['clipBoard'] ??
'',
468 'id="checkClipBoard"'
472 $this->view
->assign('showClipBoard', (bool)$this->MOD_SETTINGS
['clipBoard']);
473 $this->view
->assign('clipBoardHtml', $this->filelist
->clipObj
->printClipboard());
474 $this->view
->assign('folderIdentifier', $this->folderObject
->getCombinedIdentifier());
475 $this->view
->assign('fileDenyPattern', $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern']);
476 $this->view
->assign('maxFileSize', GeneralUtility
::getMaxUploadFileSize() * 1024);
478 $this->forward('missingFolder');
484 public function missingFolderAction()
486 if ($this->errorMessage
) {
487 $this->errorMessage
->setSeverity(FlashMessage
::ERROR
);
488 $this->controllerContext
->getFlashMessageQueue('core.template.flashMessages')->addMessage($this->errorMessage
);
493 * Search for files by name and pass them with a facade to fluid
495 * @param string $searchWord
497 public function searchAction($searchWord = '')
499 if (empty($searchWord)) {
500 $this->forward('index');
504 $files = $this->fileRepository
->searchByName($this->folderObject
, $searchWord);
507 $this->controllerContext
->getFlashMessageQueue('core.template.flashMessages')->addMessage(
509 LocalizationUtility
::translate('flashmessage.no_results', 'filelist'),
515 foreach ($files as $file) {
516 $fileFacades[] = new \TYPO3\CMS\Filelist\
FileFacade($file);
520 $pageRenderer = $this->view
->getModuleTemplate()->getPageRenderer();
521 $pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileList');
523 $thumbnailConfiguration = GeneralUtility
::makeInstance(ThumbnailConfiguration
::class);
524 $this->view
->assign('thumbnail', [
525 'width' => $thumbnailConfiguration->getWidth(),
526 'height' => $thumbnailConfiguration->getHeight(),
529 $this->view
->assign('searchWord', $searchWord);
530 $this->view
->assign('files', $fileFacades);
531 $this->view
->assign('deleteUrl', BackendUtility
::getModuleUrl('tce_file'));
532 $this->view
->assign('settings', [
533 'jsConfirmationDelete' => $this->getBackendUser()->jsConfirmation(JsConfirmation
::DELETE
)
536 $pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileDelete');
537 $pageRenderer->addInlineLanguageLabelFile('EXT:lang/Resources/Private/Language/locallang_alt_doc.xlf', 'buttons');
541 * Get main headline based on active folder or storage for backend module
542 * Folder names are resolved to their special names like done in the tree view.
546 protected function getModuleHeadline()
548 $name = $this->folderObject
->getName();
550 // Show storage name on storage root
551 if ($this->folderObject
->getIdentifier() === '/') {
552 $name = $this->folderObject
->getStorage()->getName();
555 $name = key(ListUtility
::resolveSpecialFolderNames(
556 [$name => $this->folderObject
]
563 * Registers the Icons into the docheader
565 * @throws \InvalidArgumentException
567 protected function registerDocHeaderButtons()
569 /** @var ButtonBar $buttonBar */
570 $buttonBar = $this->view
->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
573 $cshButton = $buttonBar->makeHelpButton()
574 ->setModuleName('xMOD_csh_corebe')
575 ->setFieldName('filelist_module');
576 $buttonBar->addButton($cshButton);
580 * Create the panel of buttons for submitting the form or otherwise perform operations.
582 * @return array All available buttons as an assoc. array
584 protected function registerButtons()
586 /** @var ButtonBar $buttonBar */
587 $buttonBar = $this->view
->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
589 /** @var IconFactory $iconFactory */
590 $iconFactory = $this->view
->getModuleTemplate()->getIconFactory();
592 /** @var $resourceFactory ResourceFactory */
593 $resourceFactory = GeneralUtility
::makeInstance(ResourceFactory
::class);
595 $lang = $this->getLanguageService();
598 $refreshLink = GeneralUtility
::linkThisScript(
600 'target' => rawurlencode($this->folderObject
->getCombinedIdentifier()),
601 'imagemode' => $this->filelist
->thumbs
604 $refreshButton = $buttonBar->makeLinkButton()
605 ->setHref($refreshLink)
606 ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.reload'))
607 ->setIcon($iconFactory->getIcon('actions-refresh', Icon
::SIZE_SMALL
));
608 $buttonBar->addButton($refreshButton, ButtonBar
::BUTTON_POSITION_RIGHT
);
612 $currentStorage = $this->folderObject
->getStorage();
613 $parentFolder = $this->folderObject
->getParentFolder();
614 if ($parentFolder->getIdentifier() !== $this->folderObject
->getIdentifier()
615 && $currentStorage->isWithinFileMountBoundaries($parentFolder)
617 $levelUpClick = 'top.document.getElementsByName("navigation")[0].contentWindow.Tree.highlightActiveItem("file","folder'
618 . GeneralUtility
::md5int($parentFolder->getCombinedIdentifier()) . '_"+top.fsMod.currentBank)';
619 $levelUpButton = $buttonBar->makeLinkButton()
620 ->setHref(BackendUtility
::getModuleUrl('file_FilelistList', ['id' => $parentFolder->getCombinedIdentifier()]))
621 ->setOnClick($levelUpClick)
622 ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.upOneLevel'))
623 ->setIcon($iconFactory->getIcon('actions-view-go-up', Icon
::SIZE_SMALL
));
624 $buttonBar->addButton($levelUpButton, ButtonBar
::BUTTON_POSITION_LEFT
, 1);
626 } catch (\Exception
$e) {
630 if ($this->getBackendUser()->mayMakeShortcut()) {
631 $shortCutButton = $buttonBar->makeShortcutButton()->setModuleName('file_FilelistList');
632 $buttonBar->addButton($shortCutButton, ButtonBar
::BUTTON_POSITION_RIGHT
);
635 // Upload button (only if upload to this directory is allowed)
636 if ($this->folderObject
&& $this->folderObject
->getStorage()->checkUserActionPermission(
639 ) && $this->folderObject
->checkActionPermission('write')
641 $uploadButton = $buttonBar->makeLinkButton()
642 ->setHref(BackendUtility
::getModuleUrl(
645 'target' => $this->folderObject
->getCombinedIdentifier(),
646 'returnUrl' => $this->filelist
->listURL(),
649 ->setClasses('t3js-drag-uploader-trigger')
650 ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.upload'))
651 ->setIcon($iconFactory->getIcon('actions-edit-upload', Icon
::SIZE_SMALL
));
652 $buttonBar->addButton($uploadButton, ButtonBar
::BUTTON_POSITION_LEFT
, 1);
656 if ($this->folderObject
&& $this->folderObject
->checkActionPermission('write')
657 && ($this->folderObject
->getStorage()->checkUserActionPermission(
660 ) ||
$this->folderObject
->checkActionPermission('add'))
662 $newButton = $buttonBar->makeLinkButton()
663 ->setHref(BackendUtility
::getModuleUrl(
666 'target' => $this->folderObject
->getCombinedIdentifier(),
667 'returnUrl' => $this->filelist
->listURL(),
670 ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.new'))
671 ->setIcon($iconFactory->getIcon('actions-add', Icon
::SIZE_SMALL
));
672 $buttonBar->addButton($newButton, ButtonBar
::BUTTON_POSITION_LEFT
, 1);
675 // Add paste button if clipboard is initialized
676 if ($this->filelist
->clipObj
instanceof Clipboard
&& $this->folderObject
->checkActionPermission('write')) {
677 $elFromTable = $this->filelist
->clipObj
->elFromTable('_FILE');
678 if (!empty($elFromTable)) {
679 $addPasteButton = true;
681 foreach ($elFromTable as $key => $element) {
682 $clipBoardElement = $resourceFactory->retrieveFileOrFolderObject($element);
683 if ($clipBoardElement instanceof Folder
&& $clipBoardElement->getStorage()->isWithinFolder(
688 $addPasteButton = false;
690 $elToConfirm[$key] = $clipBoardElement->getName();
692 if ($addPasteButton) {
693 $confirmText = $this->filelist
->clipObj
694 ->confirmMsgText('_FILE', $this->folderObject
->getReadablePath(), 'into', $elToConfirm);
695 $pasteButton = $buttonBar->makeLinkButton()
696 ->setHref($this->filelist
->clipObj
697 ->pasteUrl('_FILE', $this->folderObject
->getCombinedIdentifier()))
698 ->setClasses('t3js-modal-trigger')
699 ->setDataAttributes([
700 'severity' => 'warning',
701 'content' => $confirmText,
702 'title' => $lang->getLL('clip_paste')
704 ->setTitle($lang->getLL('clip_paste'))
705 ->setIcon($iconFactory->getIcon('actions-document-paste-into', Icon
::SIZE_SMALL
));
706 $buttonBar->addButton($pasteButton, ButtonBar
::BUTTON_POSITION_LEFT
, 2);
713 * Returns an instance of LanguageService
715 * @return \TYPO3\CMS\Core\Localization\LanguageService
717 protected function getLanguageService()
719 return $GLOBALS['LANG'];
723 * Returns the current BE user.
725 * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
727 protected function getBackendUser()
729 return $GLOBALS['BE_USER'];