diff options
author | jim-p <jimp@pfsense.org> | 2011-01-10 17:49:42 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-01-10 17:49:42 -0500 |
commit | b2254c7f38051040194936d033f3982397ec1a96 (patch) | |
tree | 894b0fccbc7aeb61c7a887ffca07d559cf2087e4 /usr | |
parent | 887b5af57341fb29f1d8dae271315b43beda33d9 (diff) | |
download | pfsense-b2254c7f38051040194936d033f3982397ec1a96.zip pfsense-b2254c7f38051040194936d033f3982397ec1a96.tar.gz |
Sort services on the services status page and widget.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/status_services.php | 10 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/services_status.widget.php | 7 |
2 files changed, 15 insertions, 2 deletions
diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php index 779e396..d463f3a 100755 --- a/usr/local/www/status_services.php +++ b/usr/local/www/status_services.php @@ -334,9 +334,15 @@ foreach (array('server', 'client') as $mode) { } } } - - + +function service_name_compare($a, $b) { + if (strtolower($a['name']) == strtolower($b['name'])) + return 0; + return (strtolower($a['name']) < strtolower($b['name'])) ? -1 : 1; +} + if (count($services) > 0) { + uasort($services, "service_name_compare"); foreach($services as $service) { if (empty($service['name'])) continue; diff --git a/usr/local/www/widgets/widgets/services_status.widget.php b/usr/local/www/widgets/widgets/services_status.widget.php index 71aa2b5..f41e7f5 100644 --- a/usr/local/www/widgets/widgets/services_status.widget.php +++ b/usr/local/www/widgets/widgets/services_status.widget.php @@ -177,7 +177,14 @@ if(isset($_POST['servicestatusfilter'])) { <?php $skipservices = explode(",", str_replace(" ", "", $config['widgets']['servicestatusfilter'])); +function service_name_compare($a, $b) { + if (strtolower($a['name']) == strtolower($b['name'])) + return 0; + return (strtolower($a['name']) < strtolower($b['name'])) ? -1 : 1; +} + if (count($services) > 0) { + uasort($services, "service_name_compare"); foreach($services as $service) { if((!$service['name']) || (in_array($service['name'], $skipservices))) continue; |