From be30ff59ef7bc9ac3ed71974373081763f0f2ec9 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 19 Apr 2017 13:11:19 +0200 Subject: [PATCH] Do not show empty admin sections Fixes #4393 It is far from efficient code. But then again it is easy to understand and I doubt admins will browse it 24/7 Signed-off-by: Roeland Jago Douma --- settings/Controller/AdminSettingsController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/settings/Controller/AdminSettingsController.php b/settings/Controller/AdminSettingsController.php index 4bc986e708e..6c915be6f94 100644 --- a/settings/Controller/AdminSettingsController.php +++ b/settings/Controller/AdminSettingsController.php @@ -135,6 +135,10 @@ class AdminSettingsController extends Controller { /** @var \OC\Settings\Section[] $prioritizedSections */ foreach($sections as $prioritizedSections) { foreach ($prioritizedSections as $section) { + if (empty($this->settingsManager->getAdminSettings($section->getID()))) { + continue; + } + $icon = ''; if ($section instanceof IIconSection) { $icon = $section->getIcon();