[TASK] Fix typo in copyright notice
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Controller / FileSystemNavigationFrameController.php
index 854bb04..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.
  *
  *
@@ -27,6 +27,9 @@ namespace TYPO3\CMS\Backend\Controller;
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
+use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * Main script class for rendering of the folder tree
  *
@@ -72,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 = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('currentSubScript');
-               $this->cMR = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cMR');
+               $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 = \TYPO3\CMS\Core\Utility\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';
        }
 
        /**
@@ -100,7 +133,7 @@ class FileSystemNavigationFrameController {
                // Setting highlight mode:
                $this->doHighlight = !$GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.disableTitleHighlight');
                // Create template object:
-               $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
+               $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
                $this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/alt_file_navframe.html');
                $this->doc->showFlashMessages = FALSE;
@@ -135,7 +168,6 @@ class FileSystemNavigationFrameController {
         * Main function, rendering the folder tree
         *
         * @return void
-        * @todo Define visibility
         */
        public function main() {
                // Produce browse-tree:
@@ -149,7 +181,7 @@ class FileSystemNavigationFrameController {
                // Setting up the buttons and markers for docheader
                $docHeaderButtons = $this->getButtons();
                $markers = array(
-                       'IMG_RESET' => '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/close_gray.gif', ' width="16" height="16"') . ' id="treeFilterReset" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.resetFilter') . '" ' . 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.resetFilter') . '" />',
+                       'IMG_RESET' => '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/close_gray.gif', ' width="16" height="16"') . ' id="treeFilterReset" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.resetFilter') . '" ' . 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.resetFilter') . '" />',
                        'CONTENT' => $this->content
                );
                $subparts = array();
@@ -166,7 +198,6 @@ class FileSystemNavigationFrameController {
         * Outputting the accumulated content to screen
         *
         * @return void
-        * @todo Define visibility
         */
        public function printContent() {
                echo $this->content;
@@ -183,7 +214,7 @@ class FileSystemNavigationFrameController {
                        'refresh' => ''
                );
                // Refresh
-               $buttons['refresh'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
+               $buttons['refresh'] = '<a href="' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '">' . IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
                // CSH
                $buttons['csh'] = str_replace('typo3-csh-inline', 'typo3-csh-inline show-right', \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'filetree', $GLOBALS['BACK_PATH']));
                return $buttons;
@@ -199,7 +230,7 @@ class FileSystemNavigationFrameController {
         * Called by typo3/ajax.php
         *
         * @param array $params Additional parameters (not used here)
-        * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj The TYPO3AJAX object of this request
+        * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj The AjaxRequestHandler object of this request
         * @return void
         */
        public function ajaxExpandCollapse($params, $ajaxObj) {
@@ -213,6 +244,3 @@ class FileSystemNavigationFrameController {
        }
 
 }
-
-
-?>
\ No newline at end of file