setUpBasicPageRendererForBackend($this->pageRenderer, $this->extensionConfiguration, $this->getRequest(), $this->getLanguageService()); $view = $this->backendViewFactory->create($request); $this->view = $view; $this->pageRenderer->loadJavaScriptModule('@typo3/backend/element-browser.js'); $this->pageRenderer->loadJavaScriptModule('@typo3/backend/hotkeys.js'); $this->pageRenderer->addInlineLanguageLabelFile('EXT:core/Resources/Private/Language/locallang_misc.xlf'); $this->pageRenderer->addInlineLanguageLabelFile('EXT:core/Resources/Private/Language/locallang_core.xlf'); $this->initVariables($request); } /** * Returns the identifier for the browser */ public function getIdentifier(): string { return $this->identifier; } protected function initVariables(ServerRequestInterface $request) { $this->browserParameters = ElementBrowserParameters::fromRequest($request); } protected function getBodyTagParameters(): string { $bodyDataAttributes = array_merge( $this->getBParamDataAttributes(), $this->getBodyTagAttributes() ); return GeneralUtility::implodeAttributes($bodyDataAttributes, true, true); } /** * @return array Array of body-tag attributes */ protected function getBodyTagAttributes() { return []; } /** * Returns data attributes for the body tag, used by the Javascript. * * @return array Data attributes for Javascript */ protected function getBParamDataAttributes() { return $this->browserParameters->toDataAttributes(); } public function setRequest(ServerRequestInterface $request): void { $this->request = $request; // initialize here, this is a dirty hack as long as the interface does not support setting a request object properly // see ElementBrowserController.php for the process on how the program code flow is used $this->initialize($request); } protected function getRequest(): ServerRequestInterface { return $this->request ?? $GLOBALS['TYPO3_REQUEST']; } protected function getLanguageService(): LanguageService { return $GLOBALS['LANG']; } protected function getBackendUser(): BackendUserAuthentication { return $GLOBALS['BE_USER']; } }