diff options
author | NOYB <Al_Stu@Frontier.com> | 2017-02-26 14:46:24 -0800 |
---|---|---|
committer | NOYB <Al_Stu@Frontier.com> | 2017-02-26 16:09:46 -0800 |
commit | 446505a9f9be7f43e4515658f1a5444bc3732a3f (patch) | |
tree | 025208541bf4bf81dd619dcc1d65600072b5acbe /src/etc | |
parent | 69860ee4f5ff9f1e5b87bc6fdcb6dfea66062726 (diff) | |
download | pfsense-446505a9f9be7f43e4515658f1a5444bc3732a3f.zip pfsense-446505a9f9be7f43e4515658f1a5444bc3732a3f.tar.gz |
Services - Status Icon - Sort Order
Make status column sort order work correctly with the icons.
Also refactor get_service_status_icon() output string construction to be cleaner and clearer.
(2.4, 2.3)
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/service-utils.inc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/etc/inc/service-utils.inc b/src/etc/inc/service-utils.inc index 071129d..a4d2559 100644 --- a/src/etc/inc/service-utils.inc +++ b/src/etc/inc/service-utils.inc @@ -478,17 +478,20 @@ function get_service_status_icon($service, $withtext = true, $smallicon = false, } $fa_size = ($smallicon) ? "fa-1x" : "fa-lg"; - $spacer = ($withthumbs || $withtext) ? " " : ""; if ($title == "state") { - $output = "<i class=\"{$text_class} {$fa_class} {$fa_size}\" title=\"{$statustext}\"></i>{$spacer}"; + $title = $statustext; } elseif ($title == "service_state") { - $output = "<i class=\"{$text_class} {$fa_class} {$fa_size}\" title=\"" . sprintf(gettext('%1$s Service is %2$s'), $service["name"], $statustext) . "\"></i>{$spacer}"; + $title = sprintf(gettext('%1$s Service is %2$s'), $service["name"], $statustext); } elseif ($title == "description_state") { - $output = "<i class=\"{$text_class} {$fa_class} {$fa_size}\" title=\"" . sprintf(gettext('%1$s Service is %2$s'), $service["description"], $statustext) . "\"></i>{$spacer}"; + $title = sprintf(gettext('%1$s Service is %2$s'), $service["description"], $statustext); } elseif ($title == "description_service_state") { - $output = "<i class=\"{$text_class} {$fa_class} {$fa_size}\" title=\"" . sprintf(gettext('%1$s, %2$s Service is %3$s'), $service["description"], $service["name"], $statustext) . "\"></i>{$spacer}"; + $title = sprintf(gettext('%1$s, %2$s Service is %3$s'), $service["description"], $service["name"], $statustext); } + $spacer = ($withthumbs || $withtext) ? " " : ""; + + $output = "<i class=\"{$text_class} {$fa_class} {$fa_size}\" title=\"{$title}\"><span style=\"display: none\">{$statustext}</span></i>{$spacer}"; + $spacer = ($withtext) ? " " : ""; if ($withthumbs) { $output .= "<i class=\"{$text_class} {$fa_class_thumbs} {$fa_size}\" title=\"{$Thumbs_UpDown}\"></i>{$spacer}"; |