From 36217b01eecd84357b7a211d626c9452379793b9 Mon Sep 17 00:00:00 2001 From: Kasun Chathuranga Date: Wed, 31 Jul 2013 10:09:27 +0530 Subject: [PATCH] Do not show table header it there were no user groups --- libraries/server_privileges.lib.php | 38 +++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index d7800469fe..2556aa06ce 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -3234,24 +3234,26 @@ function PMA_getHtmlForUserGroupsTable() $tabs = PMA_Util::getMenuTabList(); $html_output = '

' . __('User groups') . '

'; - $html_output .= '
'; - $html_output .= PMA_generate_common_hidden_inputs(); - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $groupTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb']) . "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['usergroups']); $sql_query = "SELECT * FROM " . $groupTable; $result = PMA_queryAsControlUser($sql_query, false); - if ($result) { + + if ($result && $GLOBALS['dbi']->numRows($result)) { + $html_output .= ''; + $html_output .= PMA_generate_common_hidden_inputs(); + $html_output .= '
' . __('User group') . '' . __('Server level tabs') . '' . __('Database level tabs') . '' . __('Table level tabs') . '' . __('Action') . '
'; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $odd = true; while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { $html_output .= ''; @@ -3282,13 +3284,13 @@ function PMA_getHtmlForUserGroupsTable() $odd = ! $odd; } + + $html_output .= ''; + $html_output .= '
' + . __('User group') . '' . __('Server level tabs') . '' . __('Database level tabs') . '' . __('Table level tabs') . '' . __('Action') . '
'; + $html_output .= '
'; } $GLOBALS['dbi']->freeResult($result); - $html_output .= ''; - $html_output .= ''; - $html_output .= ''; - $html_output .= '
'; $html_output .= ''