From 89a9f36c1b72d736bea6e080add126e3c6707b26 Mon Sep 17 00:00:00 2001 From: xmujay Date: Wed, 1 May 2013 18:53:27 +0800 Subject: [PATCH] split the long function (getServerTrafficHtml) into three functions: 1. getServerStateTrafficHtml 2. getServerStateConnectionsHtml 3. getTableProcesslistHtml --- server_status.php | 57 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/server_status.php b/server_status.php index 27d3c6ad80..afaa338efe 100644 --- a/server_status.php +++ b/server_status.php @@ -128,7 +128,28 @@ function getServerTrafficHtml($ServerStatusData) } } - $retval .= ''; + //display the server state traffic + $retval .= getServerStateTrafficHtml($ServerStatusData); + + //display the server state connection information + $retval .= getServerStateConnectionsHtml($ServerStatusData); + + //display the Table Process List information + $retval .= getTableProcesslistHtml($ServerStatusData); + + return $retval; +} + +/** + * Prints server state traffic information + * + * @param Object $ServerStatusData An instance of the PMA_ServerStatusData class + * + * @return string + */ +function getServerStateTrafficHtml($ServerStatusData) +{ + $retval = '
'; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; - $retval .= '
'; @@ -203,9 +224,20 @@ function getServerTrafficHtml($ServerStatusData) $retval .= ''; $retval .= '
'; + $retval .= ''; + return $retval; +} - $retval .= ''; +/** + * Prints server state connections information + * + * @param Object $ServerStatusData An instance of the PMA_ServerStatusData class + * + * @return string + */ +function getServerStateConnectionsHtml($ServerStatusData) +{ + $retval = '
'; $retval .= ''; $retval .= ''; $retval .= ''; @@ -291,6 +323,18 @@ function getServerTrafficHtml($ServerStatusData) $retval .= ''; $retval .= '
' . __('Connections') . '
'; + return $retval; +} + +/** + * Prints Table Process list + * + * @param Object $ServerStatusData An instance of the PMA_ServerStatusData class + * + * @return string + */ +function getTableProcesslistHtml($ServerStatusData) +{ $url_params = array(); $show_full_sql = ! empty($_REQUEST['full']); @@ -373,11 +417,8 @@ function getServerTrafficHtml($ServerStatusData) } $result = PMA_DBI_query($sql_query); - - /** - * Displays the page - */ - $retval .= ''; + + $retval = '
'; $retval .= ''; $retval .= ''; $retval .= '';
' . __('Processes') . '