summaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-12-16 16:38:15 +0100
committerGitHub <noreply@github.com>2022-12-16 16:38:15 +0100
commitd33f707bfdc49d8cb7cf6ed954a8dbe4c97472e0 (patch)
tree206061977f5027c3255221683c5b13329c2800e2 /apps/settings
parent4322fc3a0d7918bcadd1ee9d32c2ab23da6bf0ae (diff)
parent0cc50aff490a7a14ca56dcefb02f0eae53e2fd68 (diff)
downloadnextcloud-server-d33f707bfdc49d8cb7cf6ed954a8dbe4c97472e0.tar.gz
nextcloud-server-d33f707bfdc49d8cb7cf6ed954a8dbe4c97472e0.zip
Merge pull request #35609 from nextcloud/add-data-section-id
Add section-id and section-type data attributes to settings <li> navigation items
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/lib/Controller/CommonSettingsTrait.php1
-rw-r--r--apps/settings/templates/settings/frame.php7
2 files changed, 4 insertions, 4 deletions
diff --git a/apps/settings/lib/Controller/CommonSettingsTrait.php b/apps/settings/lib/Controller/CommonSettingsTrait.php
index d5d004d8722..8ca62b9d1b3 100644
--- a/apps/settings/lib/Controller/CommonSettingsTrait.php
+++ b/apps/settings/lib/Controller/CommonSettingsTrait.php
@@ -150,6 +150,7 @@ trait CommonSettingsTrait {
$activeSection = $this->settingsManager->getSection($type, $section);
if ($activeSection) {
$templateParams['pageTitle'] = $activeSection->getName();
+ $templateParams['activeSectionId'] = $activeSection->getID();
}
return new TemplateResponse('settings', 'settings/frame', $templateParams);
diff --git a/apps/settings/templates/settings/frame.php b/apps/settings/templates/settings/frame.php
index 93b03ac7eca..b2b2f04ebe0 100644
--- a/apps/settings/templates/settings/frame.php
+++ b/apps/settings/templates/settings/frame.php
@@ -40,7 +40,7 @@ script('files', 'jquery.fileupload');
$anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.PersonalSettings.index', ['section' => $form['anchor']]);
$class = 'nav-icon-' . $form['anchor'];
$sectionName = $form['section-name']; ?>
- <li <?php print_unescaped($form['active'] ? ' class="active"' : ''); ?>>
+ <li <?php print_unescaped($form['active'] ? ' class="active"' : ''); ?> data-section-id="<?php print_unescaped($form['anchor']); ?>" data-section-type="personal">
<a href="<?php p($anchor); ?>"<?php print_unescaped($form['active'] ? ' aria-current="page"' : ''); ?>>
<?php if (!empty($form['icon'])) { ?>
<img alt="" src="<?php print_unescaped($form['icon']); ?>">
@@ -66,7 +66,7 @@ script('files', 'jquery.fileupload');
$anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => $form['anchor']]);
$class = 'nav-icon-' . $form['anchor'];
$sectionName = $form['section-name']; ?>
- <li <?php print_unescaped($form['active'] ? ' class="active"' : ''); ?>>
+ <li <?php print_unescaped($form['active'] ? ' class="active"' : ''); ?> data-section-id="<?php print_unescaped($form['anchor']); ?>" data-section-type="admin">
<a href="<?php p($anchor); ?>"<?php print_unescaped($form['active'] ? ' aria-current="page"' : ''); ?>>
<?php if (!empty($form['icon'])) { ?>
<img alt="" src="<?php print_unescaped($form['icon']); ?>">
@@ -82,7 +82,6 @@ script('files', 'jquery.fileupload');
?>
</ul>
</div>
-
-<div id="app-content" tabindex="0">
+<div id="app-content" tabindex="0" data-active-section-id="<?php print_unescaped($_['activeSectionId']) ?>">
<?php print_unescaped($_['content']); ?>
</div>