uriBuilder = $uriBuilder; } /** * Creates the content for the "edit" section ("module") of the Admin Panel * * @return string HTML content for the section. Consists of a string with table-rows with four columns. */ public function getPageSettings(): string { $editToolbarService = GeneralUtility::makeInstance(EditToolbarService::class); $toolbar = $editToolbarService->createToolbar(); $view = GeneralUtility::makeInstance(StandaloneView::class); $templateNameAndPath = 'EXT:feedit/Resources/Private/Templates/Modules/Settings/Edit.html'; $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath)); $view->setPartialRootPaths(['EXT:feedit/Resources/Private/Partials']); $view->assignMultiple( [ 'display' => [ 'fieldIcons' => $this->configurationService->getConfigurationOption('edit', 'displayFieldIcons'), 'displayIcons' => $this->configurationService->getConfigurationOption('edit', 'displayIcons'), ], 'toolbar' => $toolbar, 'script' => [ 'backendScript' => $this->uriBuilder->buildUriFromRoute( 'web_layout', [ 'id' => (int)$this->getTypoScriptFrontendController()->page['uid'], ] ), 't3BeSitenameMd5' => md5('Typo3Backend-' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']), ], ] ); return $view->render(); } /** * @return TypoScriptFrontendController */ protected function getTypoScriptFrontendController(): TypoScriptFrontendController { return $GLOBALS['TSFE']; } /** * @return string */ private function getPageModule(): string { $pageModule = trim($this->getBackendUser()->getTSConfig()['options.']['overridePageModule'] ?? ''); return BackendUtility::isModuleSetInTBE_MODULES($pageModule) ? $pageModule : 'web_layout'; } /** * @inheritdoc */ public function getIdentifier(): string { return 'edit'; } /** * @inheritdoc */ public function getIconIdentifier(): string { return 'actions-open'; } /** * @inheritdoc */ public function getLabel(): string { $locallangFileAndPath = 'LLL:EXT:feedit/Resources/Private/Language/locallang_edit.xlf:module.label'; return $this->getLanguageService()->sL($locallangFileAndPath); } /** * Initialize the edit module * Includes the frontend edit initialization * * @param ServerRequestInterface $request * @return ServerRequestInterface */ public function enrich(ServerRequestInterface $request): ServerRequestInterface { return $request; } /** * @return array */ public function getJavaScriptFiles(): array { return ['EXT:feedit/Resources/Public/JavaScript/Modules/Edit.js']; } /** * Returns a string array with css files that will be rendered after the module * * @return array */ public function getCssFiles(): array { return []; } }