]> source.dussan.org Git - nextcloud-server.git/commitdiff
add a way to open the admin settings overview directly
authorszaimen <szaimen@e.mail.de>
Mon, 7 Mar 2022 10:07:25 +0000 (11:07 +0100)
committerszaimen <szaimen@e.mail.de>
Tue, 30 Aug 2022 13:46:09 +0000 (15:46 +0200)
Signed-off-by: szaimen <szaimen@e.mail.de>
apps/settings/lib/Controller/CommonSettingsTrait.php
lib/private/NavigationManager.php

index 2eb7b4ccf99bdbdac0ef731e2371154eecdb270d..4a15b0c7a32184bc9ea23946ea74705db707ffde 100644 (file)
@@ -134,7 +134,12 @@ trait CommonSettingsTrait {
        }
 
        private function getIndexResponse($type, $section) {
-               $this->navigationManager->setActiveEntry('settings');
+               if ($type === 'personal') {
+                       $this->navigationManager->setActiveEntry('settings');
+               } elseif ($type === 'admin') {
+                       $this->navigationManager->setActiveEntry('admin_settings');
+               }
+
                $templateParams = [];
                $templateParams = array_merge($templateParams, $this->getNavigationParameters($type, $section));
                $templateParams = array_merge($templateParams, $this->getSettings($section));
index 2ffd25df9b8d1a82d941948c3da894cbe2e97116..b5fa87a9860ff6c41f1458593282c06fc2be44a4 100644 (file)
@@ -211,17 +211,37 @@ class NavigationManager implements INavigationManager {
                                        'icon' => $this->urlGenerator->imagePath('settings', 'apps.svg'),
                                        'name' => $l->t('Apps'),
                                ]);
-                       }
 
-                       // Personal and (if applicable) admin settings
-                       $this->add([
-                               'type' => 'settings',
-                               'id' => 'settings',
-                               'order' => 2,
-                               'href' => $this->urlGenerator->linkToRoute('settings.PersonalSettings.index'),
-                               'name' => $l->t('Settings'),
-                               'icon' => $this->urlGenerator->imagePath('settings', 'admin.svg'),
-                       ]);
+                               // Personal settings
+                               $this->add([
+                                       'type' => 'settings',
+                                       'id' => 'settings',
+                                       'order' => 2,
+                                       'href' => $this->urlGenerator->linkToRoute('settings.PersonalSettings.index'),
+                                       'name' => $l->t('Personal settings'),
+                                       'icon' => $this->urlGenerator->imagePath('settings', 'admin.svg'),
+                               ]);
+
+                               // Admin settings
+                               $this->add([
+                                       'type' => 'settings',
+                                       'id' => 'admin_settings',
+                                       'order' => 3,
+                                       'href' => $this->urlGenerator->linkToRoute('settings.AdminSettings.index', ['section' => 'overview']),
+                                       'name' => $l->t('Admin settings'),
+                                       'icon' => $this->urlGenerator->imagePath('settings', 'admin.svg'),
+                               ]);
+                       } else {
+                               // Personal settings
+                               $this->add([
+                                       'type' => 'settings',
+                                       'id' => 'settings',
+                                       'order' => 2,
+                                       'href' => $this->urlGenerator->linkToRoute('settings.PersonalSettings.index'),
+                                       'name' => $l->t('Settings'),
+                                       'icon' => $this->urlGenerator->imagePath('settings', 'admin.svg'),
+                               ]);
+                       }
 
                        $logoutUrl = \OC_User::getLogoutUrl($this->urlGenerator);
                        if ($logoutUrl !== '') {