summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2023-10-09 16:40:08 +0200
committerGitHub <noreply@github.com>2023-10-09 16:40:08 +0200
commit4fd04080886163124b29101c2ac8021a93636cf5 (patch)
treedf631b7abb8ab404cd36df5286519e24198103ca /apps
parent14ed18c265325fe34059e387c890c8157f91f038 (diff)
parent4ad5a18afbaee35680872ebd2c848f5ff2105986 (diff)
downloadnextcloud-server-4fd04080886163124b29101c2ac8021a93636cf5.tar.gz
nextcloud-server-4fd04080886163124b29101c2ac8021a93636cf5.zip
Merge pull request #40784 from nextcloud/enh/39414/move-docs
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/css/help.css29
-rw-r--r--apps/settings/lib/Controller/HelpController.php16
-rw-r--r--apps/settings/templates/help.php113
3 files changed, 114 insertions, 44 deletions
diff --git a/apps/settings/css/help.css b/apps/settings/css/help.css
index a18538c20e6..6023a979bdf 100644
--- a/apps/settings/css/help.css
+++ b/apps/settings/css/help.css
@@ -14,3 +14,32 @@
border: 0;
overflow: auto;
}
+
+.help-wrapper {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100%;
+ width: 100%;
+}
+
+.help-content__heading {
+ text-align: center;
+ padding: 20px;
+}
+
+.help-content {
+ display: block;
+ padding: 20px;
+}
+
+.help-content__body {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-wrap: wrap;
+}
+
+.help-content__body > .button {
+ margin: 20px;
+}
diff --git a/apps/settings/lib/Controller/HelpController.php b/apps/settings/lib/Controller/HelpController.php
index aa850b7d42e..3128cbfaa23 100644
--- a/apps/settings/lib/Controller/HelpController.php
+++ b/apps/settings/lib/Controller/HelpController.php
@@ -39,6 +39,7 @@ use OCP\IL10N;
use OCP\INavigationManager;
use OCP\IRequest;
use OCP\IURLGenerator;
+use OCP\IConfig;
#[IgnoreOpenAPI]
class HelpController extends Controller {
@@ -55,6 +56,9 @@ class HelpController extends Controller {
/** @var string */
private $userId;
+ /** @var IConfig */
+ private $config;
+
public function __construct(
string $appName,
IRequest $request,
@@ -62,7 +66,8 @@ class HelpController extends Controller {
IURLGenerator $urlGenerator,
?string $userId,
IGroupManager $groupManager,
- IL10N $l10n
+ IL10N $l10n,
+ IConfig $config,
) {
parent::__construct($appName, $request);
$this->navigationManager = $navigationManager;
@@ -70,6 +75,7 @@ class HelpController extends Controller {
$this->userId = $userId;
$this->groupManager = $groupManager;
$this->l10n = $l10n;
+ $this->config = $config;
}
/**
@@ -94,6 +100,13 @@ class HelpController extends Controller {
$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');
+ }
+
$response = new TemplateResponse('settings', 'help', [
'admin' => $this->groupManager->isAdmin($this->userId),
'url' => $documentationUrl,
@@ -101,6 +114,7 @@ class HelpController extends Controller {
'urlAdminDocs' => $urlAdminDocs,
'mode' => $mode,
'pageTitle' => $pageTitle,
+ 'knowledgebaseEmbedded' => $knowledgebaseEmbedded,
]);
$policy = new ContentSecurityPolicy();
$policy->addAllowedFrameDomain('\'self\'');
diff --git a/apps/settings/templates/help.php b/apps/settings/templates/help.php
index 18cba18559a..8bc3acd6e71 100644
--- a/apps/settings/templates/help.php
+++ b/apps/settings/templates/help.php
@@ -1,48 +1,75 @@
<?php
\OC_Util::addStyle('settings', 'help');
?>
-<div id="app-navigation" role="navigation" tabindex="0">
- <ul>
- <li>
- <a class="icon-user <?php if ($_['mode'] === 'user') {
- p('active');
-} ?>" <?php if ($_['mode'] === 'user') { print_unescaped('aria-current="page"'); } ?>
- href="<?php print_unescaped($_['urlUserDocs']); ?>">
- <span class="help-list__text">
- <?php p($l->t('User documentation')); ?>
- </span>
- </a>
- </li>
- <?php if ($_['admin']) { ?>
- <li>
- <a class="icon-user-admin <?php if ($_['mode'] === 'admin') {
- p('active');
-} ?>" <?php if ($_['mode'] === 'admin') { print_unescaped('aria-current="page"'); } ?>
- href="<?php print_unescaped($_['urlAdminDocs']); ?>">
- <span class="help-list__text">
- <?php p($l->t('Administrator documentation')); ?>
- </span>
- </a>
- </li>
- <?php } ?>
+<?php if ($_['knowledgebaseEmbedded'] === true) : ?>
+ <div id="app-navigation" role="navigation" tabindex="0">
+ <ul>
+ <li>
+ <a class="icon-user <?php if ($_['mode'] === 'user') {
+ p('active');
+ } ?>" <?php if ($_['mode'] === 'user') { print_unescaped('aria-current="page"'); } ?>
+ href="<?php print_unescaped($_['urlUserDocs']); ?>">
+ <span class="help-list__text">
+ <?php p($l->t('User documentation')); ?>
+ </span>
+ </a>
+ </li>
+ <?php if ($_['admin']) { ?>
+ <li>
+ <a class="icon-user-admin <?php if ($_['mode'] === 'admin') {
+ p('active');
+ } ?>" <?php if ($_['mode'] === 'admin') { print_unescaped('aria-current="page"'); } ?>
+ href="<?php print_unescaped($_['urlAdminDocs']); ?>">
+ <span class="help-list__text">
+ <?php p($l->t('Administrator documentation')); ?>
+ </span>
+ </a>
+ </li>
+ <?php } ?>
- <li>
- <a href="https://docs.nextcloud.com" class="icon-category-office" target="_blank" rel="noreferrer noopener">
- <span class="help-list__text">
- <?php p($l->t('Documentation')); ?> ↗
- </span>
- </a>
- </li>
- <li>
- <a href="https://help.nextcloud.com" class="icon-comment" target="_blank" rel="noreferrer noopener">
- <span class="help-list__text">
- <?php p($l->t('Forum')); ?> ↗
- </span>
- </a>
- </li>
-</div>
+ <li>
+ <a href="https://docs.nextcloud.com" class="icon-category-office" target="_blank" rel="noreferrer noopener">
+ <span class="help-list__text">
+ <?php p($l->t('Documentation')); ?> ↗
+ </span>
+ </a>
+ </li>
+ <li>
+ <a href="https://help.nextcloud.com" class="icon-comment" target="_blank" rel="noreferrer noopener">
+ <span class="help-list__text">
+ <?php p($l->t('Forum')); ?> ↗
+ </span>
+ </a>
+ </li>
+ </div>
-<div id="app-content" class="help-includes">
- <iframe src="<?php print_unescaped($_['url']); ?>" class="help-iframe" tabindex="0">
- </iframe>
-</div>
+ <div id="app-content" class="help-includes">
+ <iframe src="<?php print_unescaped($_['url']); ?>" class="help-iframe" tabindex="0">
+ </iframe>
+ </div>
+<?php else: ?>
+ <div id="app-content">
+ <div class="help-wrapper">
+ <div class="help-content">
+ <h2 class="help-content__heading">
+ <?php p($l->t('Nextcloud help resources')); ?>
+ </h2>
+ <div class="help-content__body">
+ <a class="button" target="_blank" rel="noreferrer noopener"
+ href="<?php print_unescaped($_['urlUserDocs']); ?>">
+ <?php p($l->t('Account documentation')); ?> ↗
+ </a>
+ <a class="button" target="_blank" rel="noreferrer noopener"
+ href="<?php print_unescaped($_['urlAdminDocs']); ?>">
+ <?php p($l->t('Administration documentation')); ?> ↗
+ </a>
+ <a href="https://docs.nextcloud.com" class="button" target="_blank" rel="noreferrer noopener">
+ <?php p($l->t('General documentation')); ?> ↗
+ </a>
+ <a href="https://help.nextcloud.com" class="button" target="_blank" rel="noreferrer noopener">
+ <?php p($l->t('Forum')); ?> ↗
+ </a>
+ </div>
+ </div>
+ </div>
+<?php endif; ?>