2 namespace TYPO3\CMS\Documentation\Controller;
78 parent::initializeView($view);
79 $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation([]);
80 $uriBuilder = $this->objectManager->get(UriBuilder::class);
83 $this->view->getModuleTemplate()->getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Documentation/Main');
84 $menu = $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
85 $menu->setIdentifier(
'DocumentationModuleMenu');
87 $isListActive = $this->request->getControllerActionName() ===
'list' ?
true :
false;
88 $uri =
$uriBuilder->reset()->uriFor(
'list', array(),
'Document');
89 $listMenuItem = $menu->makeMenuItem()
91 ->sL(
'LLL:EXT:documentation/Resources/Private/Language/locallang.xlf:showDocumentation'))
93 ->setActive($isListActive);
94 $menu->addMenuItem($listMenuItem);
97 $isDownloadActive = $this->request->getControllerActionName() ===
98 'download' ?
true :
false;
100 $uriBuilder->reset()->uriFor(
'download', array(),
'Document');
101 $downloadMenuItem = $menu->makeMenuItem()
103 ->sL(
'LLL:EXT:documentation/Resources/Private/Language/locallang.xlf:downloadDocumentation'))
105 ->setActive($isDownloadActive);
106 $menu->addMenuItem($downloadMenuItem);
109 $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
110 $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
153 $this->view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation([]);
158 $hideDocuments = $this->
getBackendUser()->getTSConfigVal(
'mod.help_DocumentationDocumentation.documents.hide');
160 if (!empty($hideDocuments)) {
161 $documents = array_diff_key($documents, array_flip($hideDocuments));
163 $showDocuments = $this->
getBackendUser()->getTSConfigVal(
'mod.help_DocumentationDocumentation.documents.show');
165 if (!empty($showDocuments)) {
166 $documents = array_intersect_key($documents, array_flip($showDocuments));
169 $this->view->assign(
'documents', $documents);
180 $language = $this->languageUtility->getDocumentationLanguage();
181 $documents = $this->documentRepository->findByLanguage($language);
197 $this->signalSlotDispatcher->dispatch(
199 'afterInitializeDocuments',
221 $documents = $this->documentationService->getOfficialDocuments();
224 $extensions = $this->documentationService->getLocalExtensions();
225 $allDocuments = array_merge($documents, $extensions);
227 $this->view->assign(
'documents', $allDocuments);
245 $language = $this->languageUtility->getDocumentationLanguage();
247 $result = $this->documentationService->fetchNearestDocument(
$url, $key, $version ?:
'latest', $language);
260 'downloadFailedNoArchive',
270 }
catch (\Exception $e) {
273 'downloadFailedDetails',