diff options
author | xmujay <xmujay@gmail.com> | 2013-05-01 14:53:27 +0400 |
---|---|---|
committer | xmujay <xmujay@gmail.com> | 2013-05-01 14:53:27 +0400 |
commit | 89a9f36c1b72d736bea6e080add126e3c6707b26 (patch) | |
tree | 02b8a50603608cae81a39c9bd924841b17c7570f /server_status.php | |
parent | c15617fe3cfd00d7faf7ac7ea60d9afed553ac94 (diff) |
split the long function (getServerTrafficHtml) into three functions:
1. getServerStateTrafficHtml
2. getServerStateConnectionsHtml
3. getTableProcesslistHtml
Diffstat (limited to 'server_status.php')
-rw-r--r-- | server_status.php | 57 |
1 files 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 .= '<table id="serverstatustraffic" class="data noclick">'; + //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 = '<table id="serverstatustraffic" class="data noclick">'; $retval .= '<thead>'; $retval .= '<tr>'; $retval .= '<th colspan="2">'; @@ -203,9 +224,20 @@ function getServerTrafficHtml($ServerStatusData) $retval .= '</td>'; $retval .= '</tr>'; $retval .= '</tbody>'; - $retval .= '</table>'; + $retval .= '</table>'; + return $retval; +} - $retval .= '<table id="serverstatusconnections" class="data noclick">'; +/** + * Prints server state connections information + * + * @param Object $ServerStatusData An instance of the PMA_ServerStatusData class + * + * @return string + */ +function getServerStateConnectionsHtml($ServerStatusData) +{ + $retval = '<table id="serverstatusconnections" class="data noclick">'; $retval .= '<thead>'; $retval .= '<tr>'; $retval .= '<th colspan="2">' . __('Connections') . '</th>'; @@ -291,6 +323,18 @@ function getServerTrafficHtml($ServerStatusData) $retval .= '</tbody>'; $retval .= '</table>'; + 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 .= '<table id="tableprocesslist" class="data clearfloat noclick sortable">'; + + $retval = '<table id="tableprocesslist" class="data clearfloat noclick sortable">'; $retval .= '<thead>'; $retval .= '<tr>'; $retval .= '<th>' . __('Processes') . '</th>'; |