select_list/select_box: force sub-options at the end when sorting

This commit is contained in:
Benjamin Renard 2022-12-07 17:11:17 +01:00
parent a9d00cd3c1
commit a8e0707e7a

View file

@ -193,14 +193,16 @@ class LSattr_html_select_list extends LSattr_html{
**/ **/
protected static function _sortTwoValuesAsc(&$va,&$vb) { protected static function _sortTwoValuesAsc(&$va,&$vb) {
if (is_array($va)) { if (is_array($va)) {
$nva=$va['label']; // Force sub-options at the end
$nva='ZZZZ'.$va['label'];
} }
else { else {
$nva=$va; $nva=$va;
} }
if (is_array($vb)) { if (is_array($vb)) {
$nvb=$vb['label']; // Force sub-options at the end
$nvb='ZZZZ'.$vb['label'];
} }
else { else {
$nvb=$vb; $nvb=$vb;