From f2f5371d89f94625416c4a6a42d4e9d9fd06a112 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Thu, 29 Mar 2018 17:12:03 +0200 Subject: Add overview settings section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Settings/Manager.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/private/Settings/Manager.php') diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 49f699223f6..ebca8e64921 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -226,7 +226,8 @@ class Manager implements IManager { public function getAdminSections(): array { // built-in sections $sections = [ - 0 => [new Section('server', $this->l->t('Basic settings'), 0, $this->url->imagePath('settings', 'admin.svg'))], + 0 => [new Section('overview', $this->l->t('Overview'), 0, $this->url->imagePath('settings', 'admin.svg'))], + 1 => [new Section('server', $this->l->t('Basic settings'), 0, $this->url->imagePath('settings', 'admin.svg'))], 5 => [new Section('sharing', $this->l->t('Sharing'), 0, $this->url->imagePath('core', 'actions/share.svg'))], 10 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('core', 'actions/password.svg'))], 45 => [new Section('encryption', $this->l->t('Encryption'), 0, $this->url->imagePath('core', 'actions/password.svg'))], @@ -257,13 +258,18 @@ class Manager implements IManager { private function getBuiltInAdminSettings($section): array { $forms = []; - if ($section === 'server') { + if ($section === 'overview') { /** @var ISettings $form */ - $form = new Admin\Server($this->dbc, $this->request, $this->config, $this->lockingProvider, $this->l); + $form = new Admin\Overview($this->dbc, $this->request, $this->config, $this->lockingProvider, $this->l); $forms[$form->getPriority()] = [$form]; $form = new Admin\ServerDevNotice(); $forms[$form->getPriority()] = [$form]; } + if ($section === 'server') { + /** @var ISettings $form */ + $form = new Admin\Server($this->dbc, $this->request, $this->config, $this->lockingProvider, $this->l); + $forms[$form->getPriority()] = [$form]; + } if ($section === 'encryption') { /** @var ISettings $form */ $form = new Admin\Encryption($this->encryptionManager, $this->userManager); -- cgit v1.2.3 From 9a6b2d28fa4bb6f10a8568c37a5729ac00054561 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Thu, 29 Mar 2018 17:23:22 +0200 Subject: Move additional settings to main server settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Settings/Admin/Mail.php | 4 ++-- lib/private/Settings/Manager.php | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/private/Settings/Manager.php') diff --git a/lib/private/Settings/Admin/Mail.php b/lib/private/Settings/Admin/Mail.php index 46a0d654f57..74a94a4c7a0 100644 --- a/lib/private/Settings/Admin/Mail.php +++ b/lib/private/Settings/Admin/Mail.php @@ -29,7 +29,7 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; use OCP\Settings\ISettings; -class Additional implements ISettings { +class Mail implements ISettings { /** @var IConfig */ private $config; @@ -81,6 +81,6 @@ class Additional implements ISettings { * E.g.: 70 */ public function getPriority() { - return 0; + return 10; } } diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index ebca8e64921..68f43a60c90 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -269,6 +269,8 @@ class Manager implements IManager { /** @var ISettings $form */ $form = new Admin\Server($this->dbc, $this->request, $this->config, $this->lockingProvider, $this->l); $forms[$form->getPriority()] = [$form]; + $form = new Admin\Mail($this->config); + $forms[$form->getPriority()] = [$form]; } if ($section === 'encryption') { /** @var ISettings $form */ @@ -280,11 +282,6 @@ class Manager implements IManager { $form = new Admin\Sharing($this->config, $this->l); $forms[$form->getPriority()] = [$form]; } - if ($section === 'additional') { - /** @var ISettings $form */ - $form = new Admin\Additional($this->config); - $forms[$form->getPriority()] = [$form]; - } if ($section === 'tips-tricks') { /** @var ISettings $form */ $form = new Admin\TipsTricks($this->config); -- cgit v1.2.3 From 8b0c6c6df12fb7c44f3e87f69737bb2a34752cac Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Mon, 9 Apr 2018 21:49:03 +0200 Subject: Do not hide additional settings if there are only legacy forms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Settings/Manager.php | 2 +- settings/Controller/CommonSettingsTrait.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/private/Settings/Manager.php') diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 68f43a60c90..becc670c6f9 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -227,7 +227,7 @@ class Manager implements IManager { // built-in sections $sections = [ 0 => [new Section('overview', $this->l->t('Overview'), 0, $this->url->imagePath('settings', 'admin.svg'))], - 1 => [new Section('server', $this->l->t('Basic settings'), 0, $this->url->imagePath('settings', 'admin.svg'))], + 1 => [new Section('server', $this->l->t('Basic settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))], 5 => [new Section('sharing', $this->l->t('Sharing'), 0, $this->url->imagePath('core', 'actions/share.svg'))], 10 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('core', 'actions/password.svg'))], 45 => [new Section('encryption', $this->l->t('Encryption'), 0, $this->url->imagePath('core', 'actions/password.svg'))], diff --git a/settings/Controller/CommonSettingsTrait.php b/settings/Controller/CommonSettingsTrait.php index 3d314d9ed53..10fc0d84bbd 100644 --- a/settings/Controller/CommonSettingsTrait.php +++ b/settings/Controller/CommonSettingsTrait.php @@ -66,7 +66,7 @@ trait CommonSettingsTrait { } else if($type === 'personal') { $settings = $this->settingsManager->getPersonalSettings($section->getID()); } - if (empty($settings)) { + if (empty($settings) && !($section->getID() === 'additional' && count(\OC_App::getForms('admin')) > 0)) { continue; } -- cgit v1.2.3