[TASK] Drop remaining getIndpEnv() in FileSystemNavigationFrameController 77/56277/2
authorMathias Brodala <mbrodala@pagemachine.de>
Sat, 17 Mar 2018 09:24:43 +0000 (10:24 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 17 Mar 2018 11:04:21 +0000 (12:04 +0100)
Change-Id: Ia737a81e3517b682064b83e1e9f812aff66524d5
Resolves: #84400
Releases: master
Reviewed-on: https://review.typo3.org/56277
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/FileSystemNavigationFrameController.php

index 1bd29f5..7cac408 100644 (file)
@@ -104,7 +104,7 @@ class FileSystemNavigationFrameController
     public function mainAction(ServerRequestInterface $request): ResponseInterface
     {
         $this->initializePageTemplate();
-        $this->renderFolderTree();
+        $this->renderFolderTree($request);
         return new HtmlResponse($this->content);
     }
 
@@ -240,20 +240,22 @@ class FileSystemNavigationFrameController
     public function main()
     {
         trigger_error('Method main() will be replaced by protected method renderFolderTree() in v10. Do not call from other extension', E_USER_DEPRECATED);
-        $this->renderFolderTree();
+        $this->renderFolderTree($GLOBALS['TYPO3_REQUEST']);
     }
 
     /**
      * Main function, rendering the folder tree
+     *
+     * @param ServerRequestInterface $request
      */
-    protected function renderFolderTree(): void
+    protected function renderFolderTree(ServerRequestInterface $request): void
     {
         // Produce browse-tree:
         $tree = $this->foldertree->getBrowsableTree();
         // Outputting page tree:
         $this->moduleTemplate->setContent($tree);
         // Setting up the buttons
-        $this->getButtons();
+        $this->getButtons($request);
         // Build the <body> for the module
         $this->moduleTemplate->setTitle('TYPO3 Folder Tree');
         $this->content = $this->moduleTemplate->renderContent();
@@ -261,18 +263,21 @@ class FileSystemNavigationFrameController
 
     /**
      * Register docHeader buttons
+     *
+     * @param ServerRequestInterface $request
      */
-    protected function getButtons(): void
+    protected function getButtons(ServerRequestInterface $request): void
     {
         /** @var ButtonBar $buttonBar */
         $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
-
         /** @var IconFactory $iconFactory */
         $iconFactory = $this->moduleTemplate->getIconFactory();
+        /** @var \TYPO3\CMS\Core\Http\NormalizedParams */
+        $normalizedParams = $request->getAttribute('normalizedParams');
 
         // Refresh
         $refreshButton = $buttonBar->makeLinkButton()
-            ->setHref(GeneralUtility::getIndpEnv('REQUEST_URI'))
+            ->setHref($normalizedParams->getRequestUri())
             ->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.reload'))
             ->setIcon($iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));
         $buttonBar->addButton($refreshButton, ButtonBar::BUTTON_POSITION_RIGHT);