diff options
author | Thomas Citharel <tcit@tcit.fr> | 2022-12-05 10:56:55 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2022-12-05 12:19:21 +0100 |
commit | 0cc50aff490a7a14ca56dcefb02f0eae53e2fd68 (patch) | |
tree | 87961ab8d5985b68b9f213dcb616e3c81d232898 /apps/settings | |
parent | 944be7950a0199dbc48b99dac936987b13dd0383 (diff) | |
download | nextcloud-server-0cc50aff490a7a14ca56dcefb02f0eae53e2fd68.tar.gz nextcloud-server-0cc50aff490a7a14ca56dcefb02f0eae53e2fd68.zip |
Add section-id and section-type data attributes to settings <li> navigation items
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'apps/settings')
-rw-r--r-- | apps/settings/lib/Controller/CommonSettingsTrait.php | 1 | ||||
-rw-r--r-- | apps/settings/templates/settings/frame.php | 7 |
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> |