diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-01-18 09:21:23 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-01-18 09:21:53 -0500 |
commit | 904c8c4ef96474266d0c30be914c0be786bff7d8 (patch) | |
tree | b1d9b7e0e4d12930d87da8e65ae5988c5e08c86f /src/usr | |
parent | e7ed310fb4d82bb2da42bd672e17183f95b00ac8 (diff) | |
download | pfsense-904c8c4ef96474266d0c30be914c0be786bff7d8.zip pfsense-904c8c4ef96474266d0c30be914c0be786bff7d8.tar.gz |
Improved widget sorting (case insensitive)
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/index.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php index 7c4c0f7..3816c0a 100644 --- a/src/usr/local/www/index.php +++ b/src/usr/local/www/index.php @@ -328,11 +328,12 @@ pfSense_handle_custom_code("/usr/local/pkg/dashboard/pre_dashboard"); <?php // Build the Available Widgets table using a sorted copy of the $widgets array -// Can't just ksort because the "Firewall Logs" widget has a key of "logs" +function wgtcmp($a, $b) { + return(strtolower($a['name']) > strtolower($b['name'])); +} + $available = $widgets; -$values = array_values($available); -$keys = array_keys($available); -array_multisort($values, SORT_ASC, $keys, SORT_ASC, $available); +uasort($available, 'wgtcmp'); foreach ($available as $widgetname => $widgetconfig): if ($widgetconfig['display'] == 'none'): |