Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 100 additions & 67 deletions apps/settings/templates/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,101 @@
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

\OCP\Util::addStyle('settings', 'help');

$knowledgebaseEmbedded = ($_['knowledgebaseEmbedded'] ?? false) === true;
$mode = $_['mode'] ?? '';
$isAdmin = (bool)($_['admin'] ?? false);

$url = $_['url'] ?? '';
$urlUserDocs = $_['urlUserDocs'] ?? '';
$urlAdminDocs = $_['urlAdminDocs'] ?? '';
$legalNoticeUrl = $_['legalNoticeUrl'] ?? '';
$privacyUrl = $_['privacyUrl'] ?? '';

$resources = [
[
'label' => $l->t('Account documentation'),
'standaloneLabel' => $l->t('Account documentation'),
'href' => $urlUserDocs,
'show' => true,
'embeddedIcon' => 'icon-user',
'embeddedMode' => 'user',
'external' => false,
],
[
'label' => $l->t('Administration documentation'),
'standaloneLabel' => $l->t('Administration documentation'),
'href' => $urlAdminDocs,
'show' => $isAdmin,
'embeddedIcon' => 'icon-user-admin',
'embeddedMode' => 'admin',
'external' => false,
],
[
'label' => $l->t('Documentation'),
'standaloneLabel' => $l->t('General documentation'),
'href' => 'https://docs.nextcloud.com',
'show' => true,
'embeddedIcon' => 'icon-category-office',
'external' => true,
],
[
'label' => $l->t('Forum'),
'standaloneLabel' => $l->t('Forum'),
'href' => 'https://help.nextcloud.com',
'show' => true,
'embeddedIcon' => 'icon-comment',
'external' => true,
],
[
'label' => $l->t('Legal notice'),
'standaloneLabel' => $l->t('Legal notice'),
'href' => $legalNoticeUrl,
'show' => !empty($legalNoticeUrl),
'external' => true,
],
[
'label' => $l->t('Privacy policy'),
'standaloneLabel' => $l->t('Privacy policy'),
'href' => $privacyUrl,
'show' => !empty($privacyUrl),
'external' => true,
],
];
?>
<?php if ($_['knowledgebaseEmbedded'] === true) : ?>

<?php if ($knowledgebaseEmbedded): ?>
<div id="app-navigation" role="navigation" tabindex="0">
<ul>
<li>
<a class="help-list__link 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('Account documentation')); ?>
</span>
</a>
</li>
<?php if ($_['admin']) { ?>
<li>
<a class="help-list__link 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('Administration documentation')); ?>
</span>
</a>
</li>
<?php } ?>
<?php foreach ($resources as $resource): ?>
<?php
if (!$resource['show'] || !isset($resource['embeddedIcon'])) {
continue;
}

<li>
<a href="https://docs.nextcloud.com" class="help-list__link 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="help-list__link icon-comment" target="_blank" rel="noreferrer noopener">
<span class="help-list__text">
<?php p($l->t('Forum')); ?> ↗
</span>
</a>
</li>
$isCurrent = isset($resource['embeddedMode']) && $resource['embeddedMode'] === $mode;
$linkClass = 'help-list__link ' . $resource['embeddedIcon'] . ($isCurrent ? ' active' : '');
$isExternal = $resource['external'] ?? false;
?>
<li>
<a
class="<?php p($linkClass); ?>"
<?php if ($isCurrent): ?>aria-current="page"<?php endif; ?>
href="<?php print_unescaped($resource['href']); ?>"
<?php if ($isExternal): ?>target="_blank" rel="noreferrer noopener"<?php endif; ?>>
<span class="help-list__text">
<?php p($resource['label'] . ($isExternal ? ' ↗' : '')); ?>
</span>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>

<div id="app-content" class="help-includes">
<iframe src="<?php print_unescaped($_['url']); ?>" class="help-iframe" tabindex="0">
</iframe>
<iframe src="<?php print_unescaped($url); ?>" class="help-iframe" tabindex="0"></iframe>
</div>
<?php else: ?>
<div id="app-content">
Expand All @@ -63,30 +107,19 @@
<?php p($l->t('Nextcloud help & privacy 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>
<?php if ($_['legalNoticeUrl']) { ?>
<a href="<?php print_unescaped($_['legalNoticeUrl']); ?>" class="button" target="_blank" rel="noreferrer noopener">
<?php p($l->t('Legal notice')); ?> ↗
</a>
<?php } ?>
<?php if ($_['privacyUrl']) { ?>
<a href="<?php print_unescaped($_['privacyUrl']); ?>" class="button" target="_blank" rel="noreferrer noopener">
<?php p($l->t('Privacy policy')); ?> ↗
</a>
<?php } ?>
<?php foreach ($resources as $resource): ?>
<?php if (!$resource['show']) {
continue;
} ?>
<a
class="button"
target="_blank"
rel="noreferrer noopener"
href="<?php print_unescaped($resource['href']); ?>">
<?php p(($resource['standaloneLabel'] ?? $resource['label']) . ' ↗'); ?>
</a>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
Expand Down
16 changes: 11 additions & 5 deletions apps/settings/templates/settings/additional.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@

?>

<?php foreach ($_['forms'] as $form) {
if (isset($form['form'])) {?>
<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
<?php }
} ?>
<?php foreach ($_['forms'] as $form): ?>
<?php
$formHtml = $form['form'] ?? null;
if ($formHtml === null) {
continue;
}

$anchor = $form['anchor'] ?? '';
?>
<div id="<?php p($anchor); ?>"><?php print_unescaped($formHtml); ?></div>
<?php endforeach; ?>
13 changes: 11 additions & 2 deletions apps/settings/templates/settings/admin/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@
/** @var array $_ */
/** @var \OCP\Defaults $theme */

$baseUrl = $theme->getBaseUrl();
$versionLabel = $_['version'] ?? '';
?>

<div id="vue-admin-settings-setup-checks"></div>

<div id="version" class="section">
<!-- should be the last part, so Updater can follow if enabled (it has no heading therefore). -->
<h2><?php p($l->t('Version'));?></h2>
<p><strong><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" rel="noreferrer noopener" target="_blank">Nextcloud Hub 26 Winter</a> (<?php p($_['version']) ?>)</strong></p>
<h2><?php p($l->t('Version')); ?></h2>
<p>
<strong>
<a href="<?php print_unescaped($baseUrl); ?>" rel="noreferrer noopener" target="_blank">
Nextcloud Hub 26 Winter
</a>
(<?php p($versionLabel); ?>)
</strong>
</p>
</div>
17 changes: 15 additions & 2 deletions apps/settings/templates/settings/frame.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016-2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

style('settings', 'settings');

$activeSectionId = $_['activeSectionId'] ?? '';
$activeSectionType = $_['activeSectionType'] ?? '';

$mainAttributes = '';

if (!empty($activeSectionId)) {
$mainAttributes .= ' data-active-section-id="' . $activeSectionId . '"';
}

if (!empty($activeSectionType)) {
$mainAttributes .= ' data-active-section-type="' . $activeSectionType . '"';
}
?>

<div id="app-navigation"></div>
<main id="app-content" <?php if (!empty($_['activeSectionId'])) { ?> data-active-section-id="<?php print_unescaped($_['activeSectionId']) ?>" <?php } if (!empty($_['activeSectionType'])) { ?> data-active-section-type="<?php print_unescaped($_['activeSectionType']) ?>" <?php } ?>>
<main id="app-content"<?php print_unescaped($mainAttributes); ?>>
<?php print_unescaped($_['content']); ?>
</main>
122 changes: 61 additions & 61 deletions apps/settings/templates/settings/personal/development.notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,76 @@
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

$reasonsPdfLink = $_['reasons-use-nextcloud-pdf-link'] ?? '';

$aboutPlaceholders = [
'{communityopen}',
'{githubopen}',
'{licenseopen}',
'{linkclose}',
];
$aboutReplacements = [
'<a href="https://nextcloud.com/contribute" target="_blank" rel="noreferrer noopener">',
'<a href="https://github.com/nextcloud" target="_blank" rel="noreferrer noopener">',
'<a href="https://www.gnu.org/licenses/agpl-3.0.html" target="_blank" rel="noreferrer noopener">',
'</a>',
];
$aboutText = $l->t(
'Developed by the {communityopen}Nextcloud community{linkclose}, the {githubopen}source code{linkclose} is licensed under the {licenseopen}AGPL{linkclose}.'
);

$socialLinks = [
[
'href' => 'https://www.facebook.com/Nextclouders/',
'icon' => image_path('core', 'facebook-light.svg'),
'label' => $l->t('Like our Facebook page'),
],
[
'href' => 'https://bsky.app/profile/nextcloud.bsky.social',
'icon' => image_path('core', 'bluesky-light.svg'),
'label' => $l->t('Follow us on Bluesky'),
],
[
'href' => 'https://mastodon.xyz/@nextcloud',
'icon' => image_path('core', 'mastodon-light.svg'),
'label' => $l->t('Follow us on Mastodon'),
],
[
'href' => 'https://nextcloud.com/blog/',
'icon' => image_path('core', 'rss.svg'),
'label' => $l->t('Check out our blog'),
],
[
'href' => 'https://newsletter.nextcloud.com/?p=subscribe&id=1',
'icon' => image_path('core', 'mail.svg'),
'label' => $l->t('Subscribe to our newsletter'),
],
];
?>

<div class="section development-notice">
<p>
<a href="<?php p($_['reasons-use-nextcloud-pdf-link']); ?>" id="open-reasons-use-nextcloud-pdf" class="link-button" target="_blank">
<a href="<?php p($reasonsPdfLink); ?>" id="open-reasons-use-nextcloud-pdf" class="link-button" target="_blank">
<span class="icon-file-text" aria-hidden="true"></span>
<?php p($l->t('Reasons to use Nextcloud in your organization'));?>
<?php p($l->t('Reasons to use Nextcloud in your organization')); ?>
</a>
</p>

<p>
<?php print_unescaped(str_replace(
[
'{communityopen}',
'{githubopen}',
'{licenseopen}',
'{linkclose}',
],
[
'<a href="https://nextcloud.com/contribute" target="_blank" rel="noreferrer noopener">',
'<a href="https://github.com/nextcloud" target="_blank" rel="noreferrer noopener">',
'<a href="https://www.gnu.org/licenses/agpl-3.0.html" target="_blank" rel="noreferrer noopener">',
'</a>',
],
$l->t('Developed by the {communityopen}Nextcloud community{linkclose}, the {githubopen}source code{linkclose} is licensed under the {licenseopen}AGPL{linkclose}.')
)); ?>
<?php print_unescaped(str_replace($aboutPlaceholders, $aboutReplacements, $aboutText)); ?>
</p>

<p class="social-button">
<?php print_unescaped(str_replace(
[
'{facebookimage}',
'{blueskyimage}',
'{mastodonimage}',
'{rssimage}',
'{mailimage}',
'{facebookopen}',
'{blueskyopen}',
'{mastodonopen}',
'{rssopen}',
'{newsletteropen}',
'{linkclose}',
'{facebooktext}',
'{blueskytext}',
'{mastodontext}',
'{rsstext}',
'{mailtext}',
],
[
image_path('core', 'facebook-light.svg'),
image_path('core', 'bluesky-light.svg'),
image_path('core', 'mastodon-light.svg'),
image_path('core', 'rss.svg'),
image_path('core', 'mail.svg'),
'<a target="_blank" rel="noreferrer noopener" href="https://www.facebook.com/Nextclouders/">',
'<a target="_blank" rel="noreferrer noopener" href="https://bsky.app/profile/nextcloud.bsky.social">',
'<a target="_blank" rel="noreferrer noopener" href="https://mastodon.xyz/@nextcloud">',
'<a target="_blank" rel="noreferrer noopener" href="https://nextcloud.com/blog/">',
'<a target="_blank" rel="noreferrer noopener" href="https://newsletter.nextcloud.com/?p=subscribe&amp;id=1">',
'</a>',
$l->t('Like our Facebook page'),
$l->t('Follow us on Bluesky'),
$l->t('Follow us on Mastodon'),
$l->t('Check out our blog'),
$l->t('Subscribe to our newsletter'),

],
'{facebookopen}<img width="50" height="50" src="{facebookimage}" title="{facebooktext}" alt="{facebooktext}">{linkclose}
{blueskyopen}<img width="50" height="50" src="{blueskyimage}" title="{blueskytext}" alt="{blueskytext}">{linkclose}
{mastodonopen}<img width="50" height="50" src="{mastodonimage}" title="{mastodontext}" alt="{mastodontext}">{linkclose}
{rssopen}<img width="50" height="50" src="{rssimage}" title="{rsstext}" alt="{rsstext}">{linkclose}
{newsletteropen}<img width="50" height="50" src="{mailimage}" title="{mailtext}" alt="{mailtext}">{linkclose}'
)); ?>
<?php foreach ($socialLinks as $socialLink): ?>
<a target="_blank" rel="noreferrer noopener" href="<?php p($socialLink['href']); ?>">
<img
width="50"
height="50"
src="<?php p($socialLink['icon']); ?>"
title="<?php p($socialLink['label']); ?>"
alt="<?php p($socialLink['label']); ?>">
</a>
<?php endforeach; ?>
</p>
</div>
Loading
Loading