Skip to content

Commit

Permalink
[TASK] Drop remaining getIndpEnv() in FileSystemNavigationFrameContro…
Browse files Browse the repository at this point in the history
…ller

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>
  • Loading branch information
mbrodala authored and lolli42 committed Mar 17, 2018
1 parent f7ef126 commit 037999f
Showing 1 changed file with 12 additions and 7 deletions.
Expand Up @@ -104,7 +104,7 @@ public function __construct()
public function mainAction(ServerRequestInterface $request): ResponseInterface
{
$this->initializePageTemplate();
$this->renderFolderTree();
$this->renderFolderTree($request);
return new HtmlResponse($this->content);
}

Expand Down Expand Up @@ -240,39 +240,44 @@ function jumpTo(id, linkObj, highlightID, bank) {
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();
}

/**
* 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);
Expand Down

0 comments on commit 037999f

Please sign in to comment.