diff --git a/libraries/server_status.lib.php b/libraries/server_status.lib.php index 611ac12291..824bdfe50d 100644 --- a/libraries/server_status.lib.php +++ b/libraries/server_status.lib.php @@ -30,6 +30,13 @@ function PMA_getHtmlForServerStatus($ServerStatusData) //display the server state connection information $retval .= PMA_getHtmlForServerStateConnections($ServerStatusData); + // display replication information + if ($GLOBALS['replication_info']['master']['status'] + || $GLOBALS['replication_info']['slave']['status'] + ) { + $retval .= PMA_getHtmlForReplicationInfo(); + } + return $retval; } @@ -69,48 +76,50 @@ function PMA_getHtmlForServerStateGeneralInfo($ServerStatusData) ) . "\n"; $retval .= '
'; + return $retval; +} + +/** + * Returns HTML to display replication information + * + * @return string HTML on replication + */ +function PMA_getHtmlForReplicationInfo() +{ + $retval = ''; if ($GLOBALS['replication_info']['master']['status'] - || $GLOBALS['replication_info']['slave']['status'] + && $GLOBALS['replication_info']['slave']['status'] ) { - $retval .= '
'; - if ($GLOBALS['replication_info']['master']['status'] - && $GLOBALS['replication_info']['slave']['status'] - ) { - $retval .= __( - 'This MySQL server works as master and ' - . 'slave in replication process.' - ); - } elseif ($GLOBALS['replication_info']['master']['status']) { - $retval .= __( - 'This MySQL server works as master ' - . 'in replication process.' - ); - } elseif ($GLOBALS['replication_info']['slave']['status']) { - $retval .= __( - 'This MySQL server works as slave ' - . 'in replication process.' - ); - } - $retval .= '
'; + $retval .= __( + 'This MySQL server works as master and ' + . 'slave in replication process.' + ); + } elseif ($GLOBALS['replication_info']['master']['status']) { + $retval .= __( + 'This MySQL server works as master ' + . 'in replication process.' + ); + } elseif ($GLOBALS['replication_info']['slave']['status']) { + $retval .= __( + 'This MySQL server works as slave ' + . 'in replication process.' + ); } + $retval .= ''; /* * if the server works as master or slave in replication process, * display useful information */ - if ($GLOBALS['replication_info']['master']['status'] - || $GLOBALS['replication_info']['slave']['status'] - ) { - $retval .= '