diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-10-10 14:24:34 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-10-19 22:04:20 +0200 |
commit | 363d9ebb130862d5fc5617e94b1c369caf02553f (patch) | |
tree | 075425b702790fdd13c58fb396d72c1e6a22f544 /lib/private/App/AppManager.php | |
parent | 08cff0777aac169dd9c758b73faa0060004fc7a0 (diff) | |
download | nextcloud-server-363d9ebb130862d5fc5617e94b1c369caf02553f.tar.gz nextcloud-server-363d9ebb130862d5fc5617e94b1c369caf02553f.zip |
feat(NavigationManager): Always sort the default app first
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib/private/App/AppManager.php')
-rw-r--r-- | lib/private/App/AppManager.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 903e8c2993f..ab7b470bb8d 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -823,9 +823,9 @@ class AppManager implements IAppManager { return $this->defaultEnabled; } - public function getDefaultAppForUser(?IUser $user = null): string { + public function getDefaultAppForUser(?IUser $user = null, bool $withFallbacks = true): string { // Set fallback to always-enabled files app - $appId = 'files'; + $appId = $withFallbacks ? 'files' : ''; $defaultApps = explode(',', $this->config->getSystemValueString('defaultapp', '')); $defaultApps = array_filter($defaultApps); @@ -834,7 +834,7 @@ class AppManager implements IAppManager { if ($user !== null) { $userDefaultApps = explode(',', $this->config->getUserValue($user->getUID(), 'core', 'defaultapp')); $defaultApps = array_filter(array_merge($userDefaultApps, $defaultApps)); - if (empty($defaultApps)) { + if (empty($defaultApps) && $withFallbacks) { /* Fallback on user defined apporder */ $customOrders = json_decode($this->config->getUserValue($user->getUID(), 'core', 'apporder', '[]'), true, flags:JSON_THROW_ON_ERROR); if (!empty($customOrders)) { @@ -845,7 +845,7 @@ class AppManager implements IAppManager { } } - if (empty($defaultApps)) { + if (empty($defaultApps) && $withFallbacks) { $defaultApps = ['dashboard','files']; } |