diff options
author | Colin Fleming <cj_fleming@sky.com> | 2013-11-14 13:44:59 +0000 |
---|---|---|
committer | Colin Fleming <cj_fleming@sky.com> | 2013-11-14 13:44:59 +0000 |
commit | 17b8c60a398c225db03cedbb936aa62b97cb4ee3 (patch) | |
tree | 4d9e4d1da58f4bcef218621252d8bcd6d5528312 /usr/local/www/widgets | |
parent | eef01b14df77186f9c1205e9e5cb83f80407d7fd (diff) | |
download | pfsense-17b8c60a398c225db03cedbb936aa62b97cb4ee3.zip pfsense-17b8c60a398c225db03cedbb936aa62b97cb4ee3.tar.gz |
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
Diffstat (limited to 'usr/local/www/widgets')
-rw-r--r-- | usr/local/www/widgets/widgets/services_status.widget.php | 18 |
1 files changed, 11 insertions, 7 deletions
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 '<tr><td class="listlr">' . $service['name'] . '</td>' . "\n"; - echo '<td class="listr">' . $service_desc[0] . '</td>' . "\n"; - 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"; + echo "<tr><td class=\"listlr\">" . $service['name'] . "</td>\n"; + echo "<td class=\"listr\">" . $service_desc[0] . "</td>\n"; + // if service is running then listr else listbg + $bgclass = null; + if (get_service_status($service)) + $bgclass = "listr"; + else + $bgclass = "listbg"; + echo "<td class=\"" . $bgclass . "\" align=\"center\">" . get_service_status_icon($service, true, true) . "</td>\n"; + echo "<td valign=\"middle\" class=\"list nowrap\">" . get_service_control_links($service) . "</td></tr>\n"; } } else { - echo "<tr><td colspan=\"3\" align=\"center\">" . gettext("No services found") . ".</td></tr>\n"; + echo "<tr><td colspan=\"3\" align=\"center\">" . gettext("No services found") . " . </td></tr>\n"; } ?> </table> |