diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-08-12 17:08:32 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-08-12 17:08:32 +0200 |
commit | 90e58b7fb3aae0db4d5017a93e04e37387c4fb30 (patch) | |
tree | 4869b03b1eb22d38ef1ee157021796fc5adb6ae2 /settings/Controller/AdminSettingsController.php | |
parent | 0fdf801c25c6a983c367e9c8be79c81c58df980b (diff) | |
download | nextcloud-server-90e58b7fb3aae0db4d5017a93e04e37387c4fb30.tar.gz nextcloud-server-90e58b7fb3aae0db4d5017a93e04e37387c4fb30.zip |
mark current section
Diffstat (limited to 'settings/Controller/AdminSettingsController.php')
-rw-r--r-- | settings/Controller/AdminSettingsController.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/settings/Controller/AdminSettingsController.php b/settings/Controller/AdminSettingsController.php index 271aa05265b..3efe481ca9e 100644 --- a/settings/Controller/AdminSettingsController.php +++ b/settings/Controller/AdminSettingsController.php @@ -72,7 +72,7 @@ class AdminSettingsController extends Controller { $this->navigationManager->setActiveEntry('admin'); $templateParams = []; - $templateParams = array_merge($templateParams, $this->getNavigationParameters()); + $templateParams = array_merge($templateParams, $this->getNavigationParameters($section)); $templateParams = array_merge($templateParams, $this->getSettings($section)); return new TemplateResponse('settings', 'admin/frame', $templateParams); @@ -126,15 +126,20 @@ class AdminSettingsController extends Controller { return ['content' => $out->fetchPage()]; } - private function getNavigationParameters() { - $a = 'anchor'; - $name = 'section-name'; - + /** + * @param string $currentSection + * @return array + */ + private function getNavigationParameters($currentSection) { $sections = $this->settingsManager->getAdminSections(); $templateParameters = []; foreach($sections as $prioritizedSections) { foreach ($prioritizedSections as $section) { - $templateParameters[] = [$a => $section->getID(), $name => $section->getName()]; + $templateParameters[] = [ + 'anchor' => $section->getID(), + 'section-name' => $section->getName(), + 'active' => $section->getID() === $currentSection, + ]; } } |