From 3061178b094f4755dbf414d029b6e68e31e3063b Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 23 Oct 2021 16:51:33 +0200 Subject: [PATCH] hide empty tabs --- inc/lib.packman.php | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/inc/lib.packman.php b/inc/lib.packman.php index 38281c0..b8d0d5f 100644 --- a/inc/lib.packman.php +++ b/inc/lib.packman.php @@ -58,22 +58,16 @@ class libPackman public static function modules($core, $modules, $type, $title) { + if (empty($modules) && !is_array($modules)) { + return null; + } + $type = $type == 'themes' ? 'themes' : 'plugins'; echo '
' . - '

' . $title . '

'; - - if (empty($modules) && !is_array($modules)) { - echo - '

' . __('There are no modules.') . '

' . - '
'; - - return null; - } - - echo + '

' . $title . '

' . '
' . '' . '' . @@ -124,6 +118,9 @@ class libPackman public static function repository($core, $modules, $type, $title) { + if (empty($modules) || !is_array($modules)) { + return null; + } if (!in_array($type, ['plugins', 'themes', 'repository'])) { return null; } @@ -133,14 +130,6 @@ class libPackman 'id="packman-repository-' . $type . '" title="' . $title . '">' . '

' . $title . '

'; - if (empty($modules) || !is_array($modules)) { - echo - '

' . __('There are no packages') . '

' . - ''; - - return null; - } - $combo_action = [__('delete') => 'delete']; if ($type == 'plugins' || $type == 'themes') {
' . __('Id') . '