diff options
author | jim-p <jimp@pfsense.org> | 2012-08-13 12:19:47 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-08-13 12:19:47 -0400 |
commit | 36d1c79884640deb7b1032b395d6b7092a690ea5 (patch) | |
tree | 77ea994f80126c1bb1230da6f038ab5371a48b08 | |
parent | fbf55ce397db55e8dd5198ac53972d23031a35da (diff) | |
download | pfsense-36d1c79884640deb7b1032b395d6b7092a690ea5.zip pfsense-36d1c79884640deb7b1032b395d6b7092a690ea5.tar.gz |
Refine the formatting of the service status icon a bit depending on its context.
-rw-r--r-- | etc/inc/service-utils.inc | 14 | ||||
-rwxr-xr-x | usr/local/www/status_services.php | 2 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/services_status.widget.php | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 487b41e..e4a942e 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -397,22 +397,26 @@ function get_service_status($service) { return $running; } -function get_service_status_icon($service, $withtext = true) { +function get_service_status_icon($service, $withtext = true, $smallicon = false) { global $g; $output = ""; if(get_service_status($service)) { $statustext = gettext("Running"); $output .= '<td class="listr"><center>' . "\n"; - $output .= "<img style=\"vertical-align:middle\" title=\"" . sprintf(gettext("%s Service is"),$service["name"]) . " {$statustext}\" src=\"/themes/" . $g["theme"] . "/images/icons/icon_service_running.gif\">"; + $output .= "<img style=\"vertical-align:middle\" title=\"" . sprintf(gettext("%s Service is"),$service["name"]) . " {$statustext}\" src=\"/themes/" . $g["theme"] . "/images/icons/"; + $output .= ($smallicon) ? "icon_pass.gif" : "icon_service_running.gif"; + $output .= "\">"; if ($withtext) - $output .= " " . $statustext; + $output .= " " . $statustext; $output .= "</td>\n"; } else { $statustext = gettext("Stopped"); $output .= '<td class="listbg"><center>' . "\n"; - $output .= "<img style=\"vertical-align:middle\" title=\"" . sprintf(gettext("%s Service is"),$service["name"]) . " {$statustext}\" src=\"/themes/" . $g["theme"] . "/images/icons/icon_service_stopped.gif\">"; + $output .= "<img style=\"vertical-align:middle\" title=\"" . sprintf(gettext("%s Service is"),$service["name"]) . " {$statustext}\" src=\"/themes/" . $g["theme"] . "/images/icons/"; + $output .= ($smallicon) ? "icon_block.gif" : "icon_service_stopped.gif"; + $output .= "\">"; if ($withtext) - $output .= "<font color=\"white\">{$statustext}</font>"; + $output .= " " . "<font color=\"white\">{$statustext}</font>"; $output .= "</td>\n"; } return $output; diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php index fb8ffdc..84c1e4e 100755 --- a/usr/local/www/status_services.php +++ b/usr/local/www/status_services.php @@ -257,7 +257,7 @@ if (count($services) > 0) { $service['description'] = get_pkg_descr($service['name']); echo '<tr><td class="listlr">' . $service['name'] . '</td>' . "\n"; echo '<td class="listr">' . $service['description'] . '</td>' . "\n"; - echo get_service_status_icon($service); + echo get_service_status_icon($service, true, true); echo '<td valign="middle" class="list" nowrap>'; echo get_service_control_links($service); echo "</td></tr>\n"; diff --git a/usr/local/www/widgets/widgets/services_status.widget.php b/usr/local/www/widgets/widgets/services_status.widget.php index dce2456..371766d 100644 --- a/usr/local/www/widgets/widgets/services_status.widget.php +++ b/usr/local/www/widgets/widgets/services_status.widget.php @@ -74,7 +74,7 @@ if (count($services) > 0) { $service['description'] = get_pkg_descr($service['name']); echo '<tr><td class="listlr">' . $service['name'] . '</td>' . "\n"; echo '<td class="listr">' . $service['description'] . '</td>' . "\n"; - echo get_service_status_icon($service); + echo get_service_status_icon($service, false, true); echo '<td valign="middle" class="list" nowrap>'; echo get_service_control_links($service); echo "</td></tr>\n"; |