[BUGFIX] Faulty expand/collapse behavior in Element Browser
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Controller / FileSystemNavigationFrameController.php
index f3412e8..e3a4f8b 100644 (file)
@@ -74,6 +74,11 @@ class FileSystemNavigationFrameController {
         */
        public $cMR;
 
+       /**
+        * @var array
+        */
+       protected $scopeData;
+
        /**
         * Constructor
         */
@@ -94,11 +99,28 @@ class FileSystemNavigationFrameController {
                // Setting GPvars:
                $this->currentSubScript = GeneralUtility::_GP('currentSubScript');
                $this->cMR = GeneralUtility::_GP('cMR');
+
+               $scopeData = (string) GeneralUtility::_GP('scopeData');
+               $scopeHash = (string) GeneralUtility::_GP('scopeHash');
+
+               if (!empty($scopeData) && GeneralUtility::hmac($scopeData) === $scopeHash) {
+                       $this->scopeData = unserialize($scopeData);
+               }
+
                // Create folder tree object:
-               /** @var $foldertree \TYPO3\CMS\Filelist\FileListFolderTree */
-               $this->foldertree = GeneralUtility::makeInstance('TYPO3\\CMS\\Filelist\\FileListFolderTree');
+               if (!empty($this->scopeData)) {
+                       $this->foldertree = GeneralUtility::makeInstance($this->scopeData['class']);
+                       $this->foldertree->thisScript = $this->scopeData['script'];
+                       $this->foldertree->ext_noTempRecyclerDirs = $this->scopeData['ext_noTempRecyclerDirs'];
+                       $GLOBALS['SOBE']->browser = new \stdClass();
+                       $GLOBALS['SOBE']->browser->mode = $this->scopeData['browser']['mode'];
+                       $GLOBALS['SOBE']->browser->act = $this->scopeData['browser']['act'];
+               } else {
+                       $this->foldertree = GeneralUtility::makeInstance('TYPO3\\CMS\\Filelist\\FileListFolderTree');
+                       $this->foldertree->thisScript = 'alt_file_navframe.php';
+               }
+
                $this->foldertree->ext_IconMode = $GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.disableIconLinkToContextmenu');
-               $this->foldertree->thisScript = 'alt_file_navframe.php';
        }
 
        /**