summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-06-22 15:19:01 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-06-23 12:38:05 +0200
commit7817811d13931886199c23c78b7d2df93800bf0d (patch)
treecaeb5dcf1f2608498ce8c0cb152d3b5e29bafd59 /lib
parent1ace1657b68687caa8cae48749eb1a98788eb244 (diff)
downloadnextcloud-server-7817811d13931886199c23c78b7d2df93800bf0d.tar.gz
nextcloud-server-7817811d13931886199c23c78b7d2df93800bf0d.zip
do not offer additional settings when there is no content
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Settings/Manager.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php
index fe2932d9762..db147e05eb9 100644
--- a/lib/private/Settings/Manager.php
+++ b/lib/private/Settings/Manager.php
@@ -469,9 +469,13 @@ class Manager implements IManager {
0 => [new Section('personal-info', $this->l->t('Personal info'), 0, $this->url->imagePath('core', 'actions/info.svg'))],
5 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('settings', 'password.svg'))],
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'))],
];
+ $legacyForms = \OC_App::getForms('personal');
+ if(count($legacyForms) > 0 && $this->hasLegacyPersonalSettingsToRender($legacyForms)) {
+ $sections[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) {
@@ -491,6 +495,19 @@ class Manager implements IManager {
}
/**
+ * @param $forms
+ * @return bool
+ */
+ private function hasLegacyPersonalSettingsToRender($forms) {
+ foreach ($forms as $form) {
+ if(trim($form) !== '') {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
* @inheritdoc
*/
public function getPersonalSettings($section) {