pageRenderer->loadJavaScriptModule('@typo3/filelist/resource-creation.js'); } protected function initVariables(ServerRequestInterface $request): void { parent::initVariables($request); $this->resourceDisplayMatcher = GeneralUtility::makeInstance(Matcher::class); $this->resourceDisplayMatcher->addMatcher(GeneralUtility::makeInstance(ResourceFolderTypeMatcher::class)); } public function render(): string { $this->initSelectedFolder(); $contentHtml = ''; if ($this->selectedFolder !== null) { $markup = []; // Build the folder creation form $resourceUtilityRenderer = GeneralUtility::makeInstance(ResourceUtilityRenderer::class, $this); $markup[] = $resourceUtilityRenderer->createFolder($this->getRequest(), $this->selectedFolder); // Create the filelist $this->filelist->start( $this->selectedFolder, MathUtility::forceIntegerInRange($this->currentPage, 1, 100000), $this->sortField, $this->sortDirection, Mode::BROWSE ); // Create the filelist header bar $markup[] = '
'; $markup[] = '
'; $markup[] = '
'; $markup[] = ' ' . $this->getSortingModeButtons(); $markup[] = ' ' . $this->getViewModeButton(); $markup[] = '
'; $markup[] = '
'; $this->filelist->setResourceDisplayMatcher($this->resourceDisplayMatcher); $this->filelist->setResourceSelectableMatcher($this->resourceSelectableMatcher); $markup[] = $this->filelist->render(null, $this->view); $contentHtml = implode(PHP_EOL, $markup); } $contentOnly = (bool)($this->getRequest()->getQueryParams()['contentOnly'] ?? false); $this->pageRenderer->setTitle($this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_browse_links.xlf:createFolder')); $this->view->assign('selectedFolder', $this->selectedFolder); $this->view->assign('content', $contentHtml); $this->view->assign('contentOnly', $contentOnly); $content = $this->view->render('ElementBrowser/ResourceCreation'); if ($contentOnly) { return $content; } $this->pageRenderer->setBodyContent('getBodyTagParameters() . '>' . $content); return $this->pageRenderer->render($this->getRequest()); } }