[TASK] Fix typo in copyright notice
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Controller / FileSystemNavigationFrameController.php
index a8484f8..e1a5521 100644 (file)
@@ -15,7 +15,7 @@ namespace TYPO3\CMS\Backend\Controller;
  *
  *  The GNU General Public License can be found at
  *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  A copy is found in the text file GPL.txt and important notices to the license
  *  from the author is found in LICENSE.txt distributed with these scripts.
  *
  *
@@ -75,22 +75,52 @@ class FileSystemNavigationFrameController {
        public $cMR;
 
        /**
+        * @var array
+        */
+       protected $scopeData;
+
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               $GLOBALS['SOBE'] = $this;
+               $GLOBALS['BACK_PATH'] = '';
+               $this->init();
+       }
+
+       /**
         * Initialiation of the script class
         *
         * @return      void
-        * @todo Define visibility
         */
-       public function init() {
+       protected function init() {
                // Setting backPath
                $this->backPath = $GLOBALS['BACK_PATH'];
                // 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';
        }
 
        /**
@@ -138,7 +168,6 @@ class FileSystemNavigationFrameController {
         * Main function, rendering the folder tree
         *
         * @return void
-        * @todo Define visibility
         */
        public function main() {
                // Produce browse-tree:
@@ -169,7 +198,6 @@ class FileSystemNavigationFrameController {
         * Outputting the accumulated content to screen
         *
         * @return void
-        * @todo Define visibility
         */
        public function printContent() {
                echo $this->content;
@@ -216,5 +244,3 @@ class FileSystemNavigationFrameController {
        }
 
 }
-
-?>
\ No newline at end of file