navigationManager->setActiveEntry('help'); $pageTitle = $this->l10n->t('Administrator documentation'); if ($mode !== 'admin') { $pageTitle = $this->l10n->t('User documentation'); $mode = 'user'; } $documentationUrl = $this->urlGenerator->getAbsoluteURL( $this->urlGenerator->linkTo('', 'core/doc/' . $mode . '/index.html') ); $urlUserDocs = $this->urlGenerator->linkToRoute('settings.Help.help', ['mode' => 'user']); $urlAdminDocs = $this->urlGenerator->linkToRoute('settings.Help.help', ['mode' => 'admin']); $knowledgebaseEmbedded = $this->config->getSystemValueBool('knowledgebase.embedded', false); if (!$knowledgebaseEmbedded) { $pageTitle = $this->l10n->t('Nextcloud help overview'); $urlUserDocs = $this->urlGenerator->linkToDocs('user'); $urlAdminDocs = $this->urlGenerator->linkToDocs('admin'); } $legalNoticeUrl = $this->appConfig->getValueString('theming', 'imprintUrl'); $privacyUrl = $this->appConfig->getValueString('theming', 'privacyUrl'); $response = new TemplateResponse('settings', 'help', [ 'admin' => $this->groupManager->isAdmin($this->userId), 'url' => $documentationUrl, 'urlUserDocs' => $urlUserDocs, 'urlAdminDocs' => $urlAdminDocs, 'mode' => $mode, 'pageTitle' => $pageTitle, 'knowledgebaseEmbedded' => $knowledgebaseEmbedded, 'legalNoticeUrl' => $legalNoticeUrl, 'privacyUrl' => $privacyUrl, ]); $policy = new ContentSecurityPolicy(); $policy->addAllowedFrameDomain('\'self\''); $response->setContentSecurityPolicy($policy); return $response; } }