diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2017-05-19 17:34:57 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2017-06-23 12:37:41 +0200 |
commit | 28fd18de43ee4371c614782a2a4b9cf0eb497faa (patch) | |
tree | 4c93b484da2c6cfbc87142438e78725936b71fee /lib/private/Settings/Manager.php | |
parent | f87318296578178ceed8ba18c0a3f99e4aa11334 (diff) | |
download | nextcloud-server-28fd18de43ee4371c614782a2a4b9cf0eb497faa.tar.gz nextcloud-server-28fd18de43ee4371c614782a2a4b9cf0eb497faa.zip |
add missing pieces to Settings Manager and fix and extend its unit tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Settings/Manager.php')
-rw-r--r-- | lib/private/Settings/Manager.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 62a74b706f6..7da8bfe65df 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -464,6 +464,22 @@ class Manager implements IManager { 15 => [new Section('sync-clients', $this->l->t('Sync clients'), 0, $this->url->imagePath('settings', 'change.svg'))], 98 => [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))], ]; + + $rows = $this->mapper->getPersonalSectionsFromDB(); + + foreach ($rows as $row) { + if (!isset($sections[$row['priority']])) { + $sections[$row['priority']] = []; + } + try { + $sections[$row['priority']][] = $this->query($row['class']); + } catch (QueryException $e) { + // skip + } + } + + ksort($sections); + return $sections; } @@ -472,6 +488,20 @@ class Manager implements IManager { */ public function getPersonalSettings($section) { $settings = $this->getBuiltInPersonalSettings($section); + $dbRows = $this->mapper->getPersonalSettingsFromDB($section); + + foreach ($dbRows as $row) { + if (!isset($settings[$row['priority']])) { + $settings[$row['priority']] = []; + } + try { + $settings[$row['priority']][] = $this->query($row['class']); + } catch (QueryException $e) { + // skip + } + } + + ksort($settings); return $settings; } } |