More efficent code reuse in tools_monitor.inc.php
At the moment the showServices() function uses an array of if statements to detect if a service is online/offline/errored to then display it in the monitor tab.
Would it not be better to use a smaller code base such as the one below which would be easier to maintain and edit for the HTML output?
data = unserialize(
data[0]['data']);
foreach($data as $srv=>$stt) {
if ($stt != -1) {
service = strtoupper(str_ireplace("server","",
srv))." Server: ";
if ($stt == 1) {
$status = ''.$app->lng("monitor_services_online_txt").'';
} else {
$status = ''.$app->lng("monitor_services_offline_txt").'';
}
$html .= '
I know this example doesn't have language support but I'm this could be worked out afterwards? This snippet would save about 70 lines of code and be generally easier to change/maintain at a later date.