diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-09-25 15:43:04 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-09-25 15:43:04 +0200 |
commit | a3a42591e2e85e5903217052b246e46dbbf4c1c7 (patch) | |
tree | 3c10fcc1c192f01a17a155fb3bcedd4e2efe1bb9 /lib | |
parent | ac19ba9c662697b568d28c4c674ee5d3025eb16c (diff) | |
download | nextcloud-server-a3a42591e2e85e5903217052b246e46dbbf4c1c7.tar.gz nextcloud-server-a3a42591e2e85e5903217052b246e46dbbf4c1c7.zip |
Support admin default order for applications
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/NavigationManager.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index ef6e6f4cb74..9ef22132ea5 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -284,10 +284,16 @@ class NavigationManager implements INavigationManager { return; } + $adminCustomOrders = json_decode($this->config->getSystemValueString('apporder', '[]'), true, flags:JSON_THROW_ON_ERROR); + $forceAdminOrder = $this->config->getSystemValueBool('apporderForce', false); if ($this->userSession->isLoggedIn()) { $user = $this->userSession->getUser(); $apps = $this->appManager->getEnabledAppsForUser($user); - $customOrders = json_decode($this->config->getUserValue($user->getUID(), 'core', 'apporder', '[]'), true, flags:JSON_THROW_ON_ERROR); + if ($forceAdminOrder) { + $customOrders = []; + } else { + $customOrders = json_decode($this->config->getUserValue($user->getUID(), 'core', 'apporder', '[]'), true, flags:JSON_THROW_ON_ERROR); + } } else { $apps = $this->appManager->getInstalledApps(); $customOrders = []; @@ -319,7 +325,7 @@ class NavigationManager implements INavigationManager { } $l = $this->l10nFac->get($app); $id = $nav['id'] ?? $app . ($key === 0 ? '' : $key); - $order = $customOrders[$app][$key] ?? $nav['order'] ?? 100; + $order = $customOrders[$app][$key] ?? $adminCustomOrders[$app][$key] ?? $nav['order'] ?? 100; $type = $nav['type']; $route = !empty($nav['route']) ? $this->urlGenerator->linkToRoute($nav['route']) : ''; $icon = isset($nav['icon']) ? $nav['icon'] : 'app.svg'; |