From a8e0707e7a7b784cec1d85e269cafd656430515f Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 7 Dec 2022 17:11:17 +0100 Subject: [PATCH] select_list/select_box: force sub-options at the end when sorting --- src/includes/class/class.LSattr_html_select_list.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/includes/class/class.LSattr_html_select_list.php b/src/includes/class/class.LSattr_html_select_list.php index 60db29e7..e42987b1 100644 --- a/src/includes/class/class.LSattr_html_select_list.php +++ b/src/includes/class/class.LSattr_html_select_list.php @@ -193,14 +193,16 @@ class LSattr_html_select_list extends LSattr_html{ **/ protected static function _sortTwoValuesAsc(&$va,&$vb) { if (is_array($va)) { - $nva=$va['label']; + // Force sub-options at the end + $nva='ZZZZ'.$va['label']; } else { $nva=$va; } if (is_array($vb)) { - $nvb=$vb['label']; + // Force sub-options at the end + $nvb='ZZZZ'.$vb['label']; } else { $nvb=$vb;