From 17b8c60a398c225db03cedbb936aa62b97cb4ee3 Mon Sep 17 00:00:00 2001 From: Colin Fleming Date: Thu, 14 Nov 2013 13:44:59 +0000 Subject: Tidy up the "Helper Icons" The "Helper Icons" at the top right of some service pages at present produces 30+ HTML errors/warnings, this is due to the table cell being wrapped in a span statement then in a div statement, table cells can only be part of a table row then within a table statement. - remove the table cell definitions from /etc/inc/service-utils.inc - add the table cell definition from /etc/inc/service-utils.inc to /usr/local/www/status_services.php and add some logic to determine if the service is running which will then determine which class statement to use and pad the icon with a space - apply the same table cell definition and logic as above to /usr/local/www/widgets/widgets/services_status.widget.php --- usr/local/www/status_services.php | 17 +++++++++++------ .../www/widgets/widgets/services_status.widget.php | 18 +++++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) (limited to 'usr') diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php index 1f1fee5..48f9db4 100755 --- a/usr/local/www/status_services.php +++ b/usr/local/www/status_services.php @@ -93,11 +93,16 @@ if (count($services) > 0) { continue; if (empty($service['description'])) $service['description'] = get_pkg_descr($service['name']); - echo '' . $service['name'] . '' . "\n"; - echo '' . $service['description'] . '' . "\n"; - echo get_service_status_icon($service, true, true); - echo ''; - echo get_service_control_links($service); + echo "" . $service['name'] . "\n"; + echo "" . $service['description'] . "\n"; + // if service is running then listr else listbg + $bgclass = null; + if (get_service_status($service)) + $bgclass = "listr"; + else + $bgclass = "listbg"; + echo "" . get_service_status_icon($service, true, true) . "\n"; + echo "" . get_service_control_links($service); $scut = get_shortcut_by_service_name($service['name']); if (!empty($scut)) { echo get_shortcut_main_link($scut, true, $service); @@ -107,7 +112,7 @@ if (count($services) > 0) { echo "\n"; } } else { - echo "" . gettext("No services found") . ".\n"; + echo "" . gettext("No services found") . " . \n"; } ?> diff --git a/usr/local/www/widgets/widgets/services_status.widget.php b/usr/local/www/widgets/widgets/services_status.widget.php index 9ae8696..dfe172b 100644 --- a/usr/local/www/widgets/widgets/services_status.widget.php +++ b/usr/local/www/widgets/widgets/services_status.widget.php @@ -73,15 +73,19 @@ if (count($services) > 0) { if (empty($service['description'])) $service['description'] = get_pkg_descr($service['name']); $service_desc = explode(".",$service['description']); - echo '' . $service['name'] . '' . "\n"; - echo '' . $service_desc[0] . '' . "\n"; - echo get_service_status_icon($service, false, true); - echo ''; - echo get_service_control_links($service); - echo "\n"; + echo "" . $service['name'] . "\n"; + echo "" . $service_desc[0] . "\n"; + // if service is running then listr else listbg + $bgclass = null; + if (get_service_status($service)) + $bgclass = "listr"; + else + $bgclass = "listbg"; + echo "" . get_service_status_icon($service, true, true) . "\n"; + echo "" . get_service_control_links($service) . "\n"; } } else { - echo "" . gettext("No services found") . ".\n"; + echo "" . gettext("No services found") . " . \n"; } ?> -- cgit v1.1