[TASK] Use ModuleTemplate API for EXT:filelist 68/43868/12
authorFrans Saris <franssaris@gmail.com>
Tue, 6 Oct 2015 16:27:04 +0000 (18:27 +0200)
committerFrans Saris <franssaris@gmail.com>
Tue, 13 Oct 2015 09:21:49 +0000 (11:21 +0200)
Change-Id: I44ae88c834d385f514e2082f11f4c50ebb15ce57
Releases: master
Resolves: #69877
Reviewed-on: http://review.typo3.org/43868
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-69877-UseModuleTemplateAPIForExtfilelist.rst [new file with mode: 0644]
typo3/sysext/filelist/Classes/Controller/FileListController.php
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/filelist/Resources/Private/Layouts/Default.html
typo3/sysext/filelist/Resources/Private/Partials/SearchForm.html

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69877-UseModuleTemplateAPIForExtfilelist.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69877-UseModuleTemplateAPIForExtfilelist.rst
new file mode 100644 (file)
index 0000000..9c2ed0e
--- /dev/null
@@ -0,0 +1,26 @@
+=============================================================
+Deprecation: #69877 - Use ModuleTemplate API for ext:filelist
+=============================================================
+
+Description
+===========
+
+Method ``getButtonsAndOtherMarkers`` of class ``\TYPO3\CMS\Filelist\FileList`` has been marked as deprecated.
+
+
+Impact
+======
+
+The method should not be used any longer and will be removed with TYPO3 CMS 8.
+
+
+Affected Installations
+======================
+
+All third party extensions using the mentioned method.
+
+
+Migration
+=========
+
+Use the ModuelTemplate API instead.
\ No newline at end of file
index 71b31d8..83c6645 100644 (file)
@@ -14,8 +14,11 @@ namespace TYPO3\CMS\Filelist\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\Clipboard\Clipboard;
+use TYPO3\CMS\Backend\Template\Components\ButtonBar;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Backend\View\BackendTemplateView;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
@@ -29,14 +32,17 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\File\ExtendedFileUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
+use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
+use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Filelist\FileList;
 
 /**
  * Script Class for creating the list of files in the File > Filelist module
  */
-class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
+class FileListController extends ActionController
 {
+
     /**
      * Module configuration
      *
@@ -88,7 +94,6 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
 
     /**
      * "Table"
-     *
      * @var string
      */
     public $table;
@@ -133,6 +138,18 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
     protected $fileRepository;
 
     /**
+     * @var BackendTemplateView
+     */
+    protected $view;
+
+    /**
+     * BackendTemplateView Container
+     *
+     * @var BackendTemplateView
+     */
+    protected $defaultViewObjectName = BackendTemplateView::class;
+
+    /**
      * @param \TYPO3\CMS\Core\Resource\FileRepository $fileRepository
      */
     public function injectFileRepository(\TYPO3\CMS\Core\Resource\FileRepository $fileRepository)
@@ -164,18 +181,19 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
 
         try {
             if ($combinedIdentifier) {
-                /** @var $fileFactory ResourceFactory */
-                $fileFactory = GeneralUtility::makeInstance(ResourceFactory::class);
-                $storage = $fileFactory->getStorageObjectFromCombinedIdentifier($combinedIdentifier);
+                /** @var $resourceFactory ResourceFactory */
+                $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
+                $storage = $resourceFactory->getStorageObjectFromCombinedIdentifier($combinedIdentifier);
                 $identifier = substr($combinedIdentifier, strpos($combinedIdentifier, ':') + 1);
                 if (!$storage->hasFolder($identifier)) {
                     $identifier = $storage->getFolderIdentifierFromFileIdentifier($identifier);
                 }
 
-                $this->folderObject = $fileFactory->getFolderObjectFromCombinedIdentifier($storage->getUid() . ':' . $identifier);
+                $this->folderObject = $resourceFactory->getFolderObjectFromCombinedIdentifier($storage->getUid() . ':' . $identifier);
                 // Disallow access to fallback storage 0
                 if ($storage->getUid() === 0) {
-                    throw new Exception\InsufficientFolderAccessPermissionsException('You are not allowed to access files outside your storages', 1434539815);
+                    throw new Exception\InsufficientFolderAccessPermissionsException('You are not allowed to access files outside your storages',
+                        1434539815);
                 }
                 // Disallow the rendering of the processing folder (e.g. could be called manually)
                 if ($this->folderObject && $storage->isProcessingFolder($this->folderObject)) {
@@ -234,7 +252,9 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
             );
         }
 
-        if ($this->folderObject && !$this->folderObject->getStorage()->checkFolderActionPermission('read', $this->folderObject)) {
+        if ($this->folderObject && !$this->folderObject->getStorage()->checkFolderActionPermission('read',
+                $this->folderObject)
+        ) {
             $this->folderObject = null;
         }
 
@@ -269,6 +289,23 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
     }
 
     /**
+     * Initialize the view
+     *
+     * @param ViewInterface $view The view
+     * @return void
+     */
+    public function initializeView(ViewInterface $view)
+    {
+        /** @var BackendTemplateView $view */
+        parent::initializeView($view);
+        $pageRenderer = $this->view->getModuleTemplate()->getPageRenderer();
+        $pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileListLocalisation');
+        $pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileSearch');
+        $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
+        $this->registerDocHeaderButtons();
+    }
+
+    /**
      * @return void
      */
     public function initializeIndexAction()
@@ -309,22 +346,22 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
      */
     public function indexAction()
     {
+        $pageRenderer = $this->view->getModuleTemplate()->getPageRenderer();
+        $pageRenderer->setTitle($this->getLanguageService()->getLL('files'));
 
         // There there was access to this file path, continue, make the list
         if ($this->folderObject) {
-            $requireJsModules = ['TYPO3/CMS/Filelist/FileListLocalisation', 'TYPO3/CMS/Filelist/FileSearch'];
-            $addJsInlineLabels = [];
-
-            // Create filelisting object
+            // Create fileListing object
             $this->filelist = GeneralUtility::makeInstance(FileList::class, $this);
             $this->filelist->thumbs = $this->MOD_SETTINGS['displayThumbs'];
             // Create clipboard object and initialize that
-            $this->filelist->clipObj = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Clipboard\Clipboard::class);
+            $this->filelist->clipObj = GeneralUtility::makeInstance(Clipboard::class);
             $this->filelist->clipObj->fileMode = 1;
             $this->filelist->clipObj->initializeClipboard();
             $CB = GeneralUtility::_GET('CB');
             if ($this->cmd == 'setCB') {
-                $CB['el'] = $this->filelist->clipObj->cleanUpCBC(array_merge(GeneralUtility::_POST('CBH'), (array)GeneralUtility::_POST('CBC')), '_FILE');
+                $CB['el'] = $this->filelist->clipObj->cleanUpCBC(array_merge(GeneralUtility::_POST('CBH'),
+                    (array)GeneralUtility::_POST('CBC')), '_FILE');
             }
             if (!$this->MOD_SETTINGS['clipBoard']) {
                 $CB['setP'] = 'normal';
@@ -355,51 +392,61 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
             }
             // Start up filelisting object, include settings.
             $this->pointer = MathUtility::forceIntegerInRange($this->pointer, 0, 100000);
-            $this->filelist->start($this->folderObject, $this->pointer, $this->MOD_SETTINGS['sort'], $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'], $this->MOD_SETTINGS['bigControlPanel']);
+            $this->filelist->start($this->folderObject, $this->pointer, $this->MOD_SETTINGS['sort'],
+                $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'],
+                $this->MOD_SETTINGS['bigControlPanel']);
             // Generate the list
             $this->filelist->generateList();
             // Set top JavaScript:
-            $addJsInline = 'if (top.fsMod) top.fsMod.recentIds["file"] = "' . rawurlencode($this->id) . '";' . $this->filelist->CBfunctions();
-            // Setting up the buttons and markers for docheader
-            list($buttons, $otherMarkers) = $this->filelist->getButtonsAndOtherMarkers($this->folderObject);
-            // add the folder info to the marker array
-            $otherMarkers['FOLDER_INFO'] = $this->filelist->getFolderInfo();
-            $docHeaderButtons = array_merge($this->getButtons(), $buttons);
+            $this->view->getModuleTemplate()->addJavaScriptCode(
+                'FileListIndex',
+                'if (top.fsMod) top.fsMod.recentIds["file"] = "' . rawurlencode($this->id) . '";' . $this->filelist->CBfunctions() . '
+                function jumpToUrl(URL) {
+                    window.location.href = URL;
+                    return false;
+                }
+                ');
 
             // Include DragUploader only if we have write access
             if ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File')
                 && $this->folderObject->checkActionPermission('write')
             ) {
-                $requireJsModules[] = 'TYPO3/CMS/Backend/DragUploader';
-                $addJsInlineLabelFiles[] = [
-                    'file' => ExtensionManagementUtility::extPath('lang') . 'locallang_core.xlf',
-                    'prefix' => 'file_upload'
-                ];
+                $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DragUploader');
+                $pageRenderer->addInlineLanguageLabelFile(
+                    ExtensionManagementUtility::extPath('lang') . 'locallang_core.xlf',
+                    'file_upload'
+                );
             }
 
-            $this->view->assign('otherMarkers', $otherMarkers);
-            $this->view->assign('docHeaderButtons', $docHeaderButtons);
-            $this->view->assign('pageTitle', $this->getLanguageService()->getLL('files'));
-            $this->view->assign('requireJsModules', $requireJsModules);
-            $this->view->assign('addJsInlineLabelFiles', $addJsInlineLabelFiles);
-            $this->view->assign('addJsInline', $addJsInline);
+            // Setting up the buttons
+            $this->registerButtons();
+
+            $pageRecord = [
+                '_additional_info' => $this->filelist->getFolderInfo(),
+                'combined_identifier' => $this->folderObject->getCombinedIdentifier(),
+            ];
+            $this->view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord);
+
             $this->view->assign('headline', $this->getModuleHeadline());
             $this->view->assign('listHtml', $this->filelist->HTMLcode);
             $this->view->assign('checkboxes', [
                 'bigControlPanel' => [
                     'enabled' => $this->getBackendUser()->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'selectable',
                     'label' => $this->getLanguageService()->getLL('bigControlPanel', true),
-                    'html' => BackendUtility::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], '', '', 'id="bigControlPanel"'),
+                    'html' => BackendUtility::getFuncCheck($this->id, 'SET[bigControlPanel]',
+                        $this->MOD_SETTINGS['bigControlPanel'], '', '', 'id="bigControlPanel"'),
                 ],
                 'displayThumbs' => [
                     'enabled' => $this->getBackendUser()->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'selectable',
                     'label' => $this->getLanguageService()->getLL('displayThumbs', true),
-                    'html' => BackendUtility::getFuncCheck($this->id, 'SET[displayThumbs]', $this->MOD_SETTINGS['displayThumbs'], '', '', 'id="checkDisplayThumbs"'),
+                    'html' => BackendUtility::getFuncCheck($this->id, 'SET[displayThumbs]',
+                        $this->MOD_SETTINGS['displayThumbs'], '', '', 'id="checkDisplayThumbs"'),
                 ],
                 'enableClipBoard' => [
                     'enabled' => $this->getBackendUser()->getTSConfigVal('options.file_list.enableClipBoard') === 'selectable',
                     'label' => $this->getLanguageService()->getLL('clipBoard', true),
-                    'html' => BackendUtility::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], '', '', 'id="checkClipBoard"'),
+                    'html' => BackendUtility::getFuncCheck($this->id, 'SET[clipBoard]',
+                        $this->MOD_SETTINGS['clipBoard'], '', '', 'id="checkClipBoard"'),
                 ]
             ]);
             $this->view->assign('showClipBoard', (bool)$this->MOD_SETTINGS['clipBoard']);
@@ -439,7 +486,8 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
 
         if (empty($files)) {
             $this->controllerContext->getFlashMessageQueue('core.template.flashMessages')->addMessage(
-                new FlashMessage(LocalizationUtility::translate('flashmessage.no_results', 'filelist'), '', FlashMessage::INFO)
+                new FlashMessage(LocalizationUtility::translate('flashmessage.no_results', 'filelist'), '',
+                    FlashMessage::INFO)
             );
         } else {
             foreach ($files as $file) {
@@ -447,7 +495,6 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
             }
         }
 
-        $this->view->assign('requireJsModules', ['TYPO3/CMS/Filelist/FileList', 'TYPO3/CMS/Filelist/FileSearch']);
         $this->view->assign('searchWord', $searchWord);
         $this->view->assign('files', $fileFacades);
         $this->view->assign('settings', [
@@ -457,7 +504,6 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
 
     /**
      * Get main headline based on active folder or storage for backend module
-     *
      * Folder names are resolved to their special names like done in the tree view.
      *
      * @return string
@@ -479,52 +525,138 @@ class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
     }
 
     /**
+     * Registers the Icons into the docheader
+     *
+     * @return void
+     * @throws \InvalidArgumentException
+     */
+    protected function registerDocHeaderButtons()
+    {
+        /** @var ButtonBar $buttonBar */
+        $buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
+
+        // CSH
+        $cshButton = $buttonBar->makeHelpButton()
+            ->setModuleName('xMOD_csh_corebe')
+            ->setFieldName('filelist_module');
+        $buttonBar->addButton($cshButton);
+    }
+
+    /**
      * Create the panel of buttons for submitting the form or otherwise perform operations.
      *
      * @return array All available buttons as an assoc. array
      */
-    public function getButtons()
+    protected function registerButtons()
     {
+        /** @var ButtonBar $buttonBar */
+        $buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
+
         /** @var IconFactory $iconFactory */
-        $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+        $iconFactory = $this->view->getModuleTemplate()->getIconFactory();
+
+        /** @var $resourceFactory ResourceFactory */
+        $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
+
+        // Refresh page
+        $refreshButton = $buttonBar->makeLinkButton()
+            ->setHref(GeneralUtility::linkThisScript(array(
+                'target' => rawurlencode($this->folderObject->getCombinedIdentifier()),
+                'imagemode' => $this->filelist->thumbs
+            )))
+            ->setTitle($this->getLanguageService()->makeEntities($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.reload',
+                true)))
+            ->setIcon($iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));
+        $buttonBar->addButton($refreshButton, ButtonBar::BUTTON_POSITION_RIGHT);
+
+        // Level up
+        try {
+            $currentStorage = $this->folderObject->getStorage();
+            $parentFolder = $this->folderObject->getParentFolder();
+            if ($parentFolder->getIdentifier() !== $this->folderObject->getIdentifier() && $currentStorage->isWithinFileMountBoundaries($parentFolder)) {
+                $levelUpButton = $buttonBar->makeLinkButton()
+                    ->setHref(BackendUtility::getModuleUrl('file_FilelistList',
+                        ['id' => $parentFolder->getCombinedIdentifier()]))
+                    ->setOnClick('top.document.getElementsByName("navigation")[0].contentWindow.Tree.highlightActiveItem("file","folder' . GeneralUtility::md5int($parentFolder->getCombinedIdentifier()) . '_"+top.fsMod.currentBank)')
+                    ->setTitle($this->getLanguageService()->makeEntities($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.upOneLevel',
+                        true)))
+                    ->setIcon($iconFactory->getIcon('actions-view-go-up', Icon::SIZE_SMALL));
+                $buttonBar->addButton($levelUpButton, ButtonBar::BUTTON_POSITION_LEFT, 1);
+            }
+        } catch (\Exception $e) {
+        }
 
-        $buttons = array(
-            'csh' => '',
-            'shortcut' => '',
-            'upload' => '',
-            'new' => ''
-        );
-        // Add shortcut
+        // Shortcut
         if ($this->getBackendUser()->mayMakeShortcut()) {
-            $buttons['shortcut'] = $this->doc->makeShortcutIcon('pointer,id,target,table', implode(',', array_keys($this->MOD_MENU)), $this->moduleName);
+            $shortCutButton = $buttonBar->makeShortcutButton()->setModuleName('file_FilelistList');
+            $buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT);
         }
-        // FileList Module CSH:
-        $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_module');
+
         // Upload button (only if upload to this directory is allowed)
-        if ($this->folderObject && $this->folderObject->getStorage()->checkUserActionPermission('add', 'File') && $this->folderObject->checkActionPermission('write')) {
-            $buttons['upload'] = '<a href="' . htmlspecialchars(
-                BackendUtility::getModuleUrl(
+        if ($this->folderObject && $this->folderObject->getStorage()->checkUserActionPermission('add',
+                'File') && $this->folderObject->checkActionPermission('write')
+        ) {
+            $uploadButton = $buttonBar->makeLinkButton()
+                ->setHref(BackendUtility::getModuleUrl(
                     'file_upload',
                     array(
                         'target' => $this->folderObject->getCombinedIdentifier(),
                         'returnUrl' => $this->filelist->listURL(),
                     )
-                )) . '" id="button-upload" title="' . $this->getLanguageService()->makeEntities($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.upload', true)) . '">' . $iconFactory->getIcon('actions-edit-upload', Icon::SIZE_SMALL)->render() . '</a>';
+                ))
+                ->setClasses('t3js-drag-uploader-trigger')
+                ->setTitle($this->getLanguageService()->makeEntities($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.upload',
+                    true)))
+                ->setIcon($iconFactory->getIcon('actions-edit-upload', Icon::SIZE_SMALL));
+            $buttonBar->addButton($uploadButton, ButtonBar::BUTTON_POSITION_LEFT, 1);
         }
+
         // New folder button
         if ($this->folderObject && $this->folderObject->checkActionPermission('write')
-            && ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File') || $this->folderObject->checkActionPermission('add'))
+            && ($this->folderObject->getStorage()->checkUserActionPermission('add',
+                    'File') || $this->folderObject->checkActionPermission('add'))
         ) {
-            $buttons['new'] = '<a href="' . htmlspecialchars(
-                BackendUtility::getModuleUrl(
+            $newButton = $buttonBar->makeLinkButton()
+                ->setHref(BackendUtility::getModuleUrl(
                     'file_newfolder',
                     array(
                         'target' => $this->folderObject->getCombinedIdentifier(),
                         'returnUrl' => $this->filelist->listURL(),
                     )
-                )) . '" title="' . $this->getLanguageService()->makeEntities($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.new', true)) . '">' . $iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render() . '</a>';
+                ))
+                ->setTitle($this->getLanguageService()->makeEntities($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.new',
+                    true)))
+                ->setIcon($iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL));
+            $buttonBar->addButton($newButton, ButtonBar::BUTTON_POSITION_LEFT, 1);
+        }
+
+        // Add paste button if clipboard is initialized
+        if ($this->filelist->clipObj instanceof Clipboard && $this->folderObject->checkActionPermission('write')) {
+            $elFromTable = $this->filelist->clipObj->elFromTable('_FILE');
+            if (!empty($elFromTable)) {
+                $addPasteButton = true;
+                $elToConfirm = array();
+                foreach ($elFromTable as $key => $element) {
+                    $clipBoardElement = $resourceFactory->retrieveFileOrFolderObject($element);
+                    if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement,
+                            $this->folderObject)
+                    ) {
+                        $addPasteButton = false;
+                    }
+                    $elToConfirm[$key] = $clipBoardElement->getName();
+                }
+                if ($addPasteButton) {
+                    $pasteButton = $buttonBar->makeLinkButton()
+                        ->setHref($this->filelist->clipObj->pasteUrl('_FILE',
+                            $this->folderObject->getCombinedIdentifier()))
+                        ->setOnClick('return ' . htmlspecialchars($this->filelist->clipObj->confirmMsg('_FILE',
+                                $this->folderObject->getReadablePath(), 'into', $elToConfirm)))
+                        ->setTitle($this->getLanguageService()->getLL('clip_paste', true))
+                        ->setIcon($iconFactory->getIcon('actions-document-paste-after', Icon::SIZE_SMALL));
+                    $buttonBar->addButton($pasteButton, ButtonBar::BUTTON_POSITION_LEFT, 2);
+                }
+            }
         }
-        return $buttons;
     }
 
     /**
index 34cfa66..9f842f6 100644 (file)
@@ -240,9 +240,11 @@ class FileList extends AbstractRecordList
      *
      * @param Folder $folderObject
      * @return array
+     * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, buttons are now defined in FileListController
      */
     public function getButtonsAndOtherMarkers(Folder $folderObject)
     {
+        GeneralUtility::logDeprecatedFunction();
         $otherMarkers = array(
             'PAGE_ICON' => '',
             'TITLE' => ''
index 0d0c2e5..162d368 100644 (file)
@@ -1,35 +1,8 @@
-{namespace fl = TYPO3\CMS\Filelist\ViewHelpers}
+<f:render section="headline" />
+<f:flashMessages queueIdentifier="core.template.flashMessages" />
+<f:render section="content" />
 
-<fl:be.container pageTitle="{pageTitle}" includeRequireJsModules="{requireJsModules}" addJsInlineLabelFiles="{addJsInlineLabelFiles}" addJsInline="{addJsInline}">
-       <div class="typo3-fullDoc t3js-drag-uploader" data-target-folder="{folderIdentifier}" data-progress-container="#typo3-filelist"
-                data-dropzone-trigger="#button-upload" data-dropzone-target="#typo3-inner-docbody h1:first"
-                data-file-deny-pattern="{fileDenyPattern}" data-max-file-size="{maxFileSize}">
-               <div id="typo3-docheader">
-                       <div class="typo3-docheader-functions">
-                               <div class="left">
-                                       <f:be.buttons.csh table="xMOD_csh_corebe" field="filelist_module" />
-                               </div>
-                               <div class="right">
-                                       {otherMarkers.TITLE} {otherMarkers.FOLDER_INFO} {otherMarkers.PAGE_ICON -> f:format.raw()}
-                               </div>
-                       </div>
-                       <div class="typo3-docheader-buttons">
-                               <div class="left">
-                                       {docHeaderButtons.level_up -> f:format.raw()}{docHeaderButtons.upload -> f:format.raw()}{docHeaderButtons.new -> f:format.raw()}{docHeaderButtons.PASTE -> f:format.raw()}
-                               </div>
-                               <div class="right">
-                                       {docHeaderButtons.refresh -> f:format.raw()}{f:be.buttons.shortcut()}
-                               </div>
-                       </div>
-               </div>
-               <div id="typo3-docbody">
-                       <div id="typo3-inner-docbody">
-                               <f:flashMessages queueIdentifier="core.template.flashMessages" />
-
-                               <f:render section="headline" />
-
-                               <f:render section="content" />
-                       </div>
-               </div>
-       </div>
-</fl:be.container>
+<div class="t3js-drag-uploader" data-target-folder="{folderIdentifier}" data-progress-container="#typo3-filelist"
+        data-dropzone-trigger=".t3js-drag-uploader-trigger" data-dropzone-target=".t3js-module-body h1:first"
+        data-file-deny-pattern="{fileDenyPattern}" data-max-file-size="{maxFileSize}"
+       ></div>
\ No newline at end of file
index b62ed88..38e6720 100644 (file)
@@ -1,9 +1,11 @@
-<f:form action="search">
-       <div class="input-group">
-               <input type="hidden" name="cmd" class="form-control" value="search">
-               <f:form.textfield type="text" name="searchWord" class="form-control" value="{searchWord}"/>
-               <span class="input-group-btn">
-                       <button class="btn btn-default" type="submit"><f:translate id="search">Search</f:translate></button>
-               </span>
+<f:form action="search" class="form-inline form-inline-spaced">
+       <div class="form-group">
+               <div class="input-group">
+                       <input type="hidden" name="cmd" class="form-control" value="search">
+                       <f:form.textfield type="text" name="searchWord" class="form-control" value="{searchWord}"/>
+                       <span class="input-group-btn">
+                               <button class="btn btn-default" type="submit"><f:translate id="search">Search</f:translate></button>
+                       </span>
+               </div>
        </div>
 </f:form>