summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2016-01-18 09:21:23 -0500
committerStephen Beaver <sbeaver@netgate.com>2016-01-18 09:21:53 -0500
commit904c8c4ef96474266d0c30be914c0be786bff7d8 (patch)
treeb1d9b7e0e4d12930d87da8e65ae5988c5e08c86f /src
parente7ed310fb4d82bb2da42bd672e17183f95b00ac8 (diff)
downloadpfsense-904c8c4ef96474266d0c30be914c0be786bff7d8.zip
pfsense-904c8c4ef96474266d0c30be914c0be786bff7d8.tar.gz
Improved widget sorting (case insensitive)
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/index.php9
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'):
OpenPOWER on IntegriCloud