From 1ce403df10a6c319a35a01a09d78cda32450dfae Mon Sep 17 00:00:00 2001 From: Neil Drumm Date: Wed, 29 Nov 2006 20:36:30 +0000 Subject: #92192 by webchick. Hide empty blocks on administer by modules. --- modules/system/system.module | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/system/system.module b/modules/system/system.module index 4011ed802..a34b2fddc 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2243,15 +2243,20 @@ function system_admin_by_module() { } $admin_tasks = system_get_module_admin_tasks($module); - // Check for help links. - if (module_invoke($module, 'help', "admin/help#$module")) { - $admin_tasks[100] = l(t('Get help'), "admin/help/$module"); - } - // Sort - ksort($admin_tasks); + // Only display a section if there are any available tasks. + if (count($admin_tasks)) { + + // Check for help links. + if (module_invoke($module, 'help', "admin/help#$module")) { + $admin_tasks[100] = l(t('Get help'), "admin/help/$module"); + } - $menu_items[$file->info['name']] = array($file->info['description'], $admin_tasks); + // Sort. + ksort($admin_tasks); + + $menu_items[$file->info['name']] = array($file->info['description'], $admin_tasks); + } } return theme('system_admin_by_module', $menu_items); } -- cgit v1.2.3