diff options
Diffstat (limited to 'lib/private/Settings')
-rw-r--r-- | lib/private/Settings/Manager.php | 19 |
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) { |