dashboardInitializationService->initializeDashboards($request, $this->getBackendUser()); $view = $this->moduleTemplateFactory->create($request); $this->preparePageRenderer(); $this->addFrontendResources(); $view->setTitle($this->getLanguageService()->translate('title', 'dashboard.module')); $view->getDocHeaderComponent()->disable(); return $view->renderResponse('Dashboard/Main'); } /** * Adds CSS and JS files that are necessary for widgets to the page renderer */ protected function addFrontendResources(): void { $javaScriptRenderer = $this->pageRenderer->getJavaScriptRenderer(); foreach ($this->dashboardInitializationService->getJavaScriptModuleInstructions() as $instruction) { $javaScriptRenderer->addJavaScriptModuleInstruction($instruction); } foreach ($this->dashboardInitializationService->getCssFiles() as $cssFile) { $this->pageRenderer->addCssFile($cssFile); } foreach ($this->dashboardInitializationService->getJsFiles() as $jsFile) { $this->pageRenderer->addJsFile($jsFile); } } /** * Add the CSS and JS of the dashboard module to the page renderer */ protected function preparePageRenderer(): void { $this->pageRenderer->loadJavaScriptModule('@typo3/dashboard/dashboard.js'); $this->pageRenderer->addCssFile('EXT:dashboard/Resources/Public/Css/dashboard.css'); } protected function getBackendUser(): BackendUserAuthentication { return $GLOBALS['BE_USER']; } protected function getLanguageService(): LanguageService { return $GLOBALS['LANG']; } }