From bf7356ecb37e263c939e6e080342369a97f9064f Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 26 Jul 2012 09:28:00 +0000 Subject: [PATCH] 2012-07-26 Sergio Martin * include/functions_html.php: Change the sort function of the html_print_select to use natural order (merging lower and upper case chars) git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6813 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_html.php | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a8386201fd..79e91eb289 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2012-07-26 Sergio Martin + + * include/functions_html.php: Change the sort function + of the html_print_select to use natural order (merging + lower and upper case chars) + 2012-07-26 Hirofumi Kosaka * godmode/agentes/module_manager_editor_common.php: diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 9e93e30b8e..f098fc84af 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -326,7 +326,8 @@ function html_print_select ($fields, $name, $selected = '', $script = '', if (is_array($fields) && !empty ($fields)) { if ($sort !== false) { - asort ($fields); + // Sorting the fields in natural way and case insensitive preserving keys + uasort($fields, "strnatcasecmp"); } $lastopttype = ''; foreach ($fields as $value => $label) {