From bfaf3fff33b663dd3e90f825445d1c95c98ea724 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 31 Jan 2020 16:55:17 +0100 Subject: Move Admin Settings also to info.xml More cleanup of the Settings apps. Makes the manager cleaner and a proper manager. Signed-off-by: Roeland Jago Douma --- lib/private/Settings/Manager.php | 48 +--------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) (limited to 'lib') diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 8018ecaba61..ed1d2f45cd7 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -227,51 +227,6 @@ class Manager implements IManager { return $sections; } - /** - * @param string $section - * @param Closure $filter - * - * @return ISection[] - */ - private function getBuiltInAdminSettings($section, Closure $filter = null): array { - $forms = []; - - if ($section === 'overview') { - /** @var ISettings $form */ - $form = $this->container->query(\OCA\Settings\Admin\Overview::class); - if ($filter === null || $filter($form)) { - $forms[$form->getPriority()] = [$form]; - } - } - if ($section === 'server') { - /** @var ISettings $form */ - $form = $this->container->query(\OCA\Settings\Admin\Server::class); - if ($filter === null || $filter($form)) { - $forms[$form->getPriority()] = [$form]; - } - $form = $this->container->query(\OCA\Settings\Admin\Mail::class); - if ($filter === null || $filter($form)) { - $forms[$form->getPriority()] = [$form]; - } - } - if ($section === 'security') { - /** @var ISettings $form */ - $form = $this->container->query(\OCA\Settings\Admin\Security::class); - if ($filter === null || $filter($form)) { - $forms[$form->getPriority()] = [$form]; - } - } - if ($section === 'sharing') { - /** @var ISettings $form */ - $form = $this->container->query(\OCA\Settings\Admin\Sharing::class); - if ($filter === null || $filter($form)) { - $forms[$form->getPriority()] = [$form]; - } - } - - return $forms; - } - /** * @inheritdoc */ @@ -280,13 +235,12 @@ class Manager implements IManager { $subAdminSettingsFilter = function(ISettings $settings) { return $settings instanceof ISubAdminSettings; }; - $settings = $this->getBuiltInAdminSettings($section, $subAdminSettingsFilter); $appSettings = $this->getSettings('admin', $section, $subAdminSettingsFilter); } else { - $settings = $this->getBuiltInAdminSettings($section); $appSettings = $this->getSettings('admin', $section); } + $settings = []; foreach ($appSettings as $setting) { if (!isset($settings[$setting->getPriority()])) { $settings[$setting->getPriority()] = []; -- cgit v1.2.3