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' => [ 'pageUid' => (int)$this->getTypoScriptFrontendController()->page['uid'], 'pageModule' => $this->getPageModule(), 'backendScript' => BackendUtility::getBackendScript(), '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 */ public function initializeModule(ServerRequestInterface $request): void { $typoScriptFrontend = $this->getTypoScriptFrontendController(); $typoScriptFrontend->displayEditIcons = $this->configurationService->getConfigurationOption('edit', 'displayIcons'); $typoScriptFrontend->displayFieldEditIcons = $this->configurationService->getConfigurationOption('edit', 'displayFieldIcons'); if ($request->getQueryParams()['ADMCMD_editIcons'] ?? $request->getParsedBody()['ADMCMD_editIcons'] ?? false) { $typoScriptFrontend->displayFieldEditIcons = '1'; } if ($typoScriptFrontend->displayEditIcons) { $typoScriptFrontend->set_no_cache('Admin Panel: Display edit icons', true); } if ($typoScriptFrontend->displayFieldEditIcons) { $typoScriptFrontend->set_no_cache('Admin Panel: Display field edit icons', true); } } /** * @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 []; } }