related to #1461 Adding natural sort order ASC and DESC

This commit is contained in:
Matthieu Leproux
2021-08-13 16:26:46 +02:00
parent 67c5a9aec5
commit e82af26cbb
4 changed files with 21 additions and 3 deletions
+4 -2
View File
@@ -30,7 +30,9 @@ $sort_orders = array(
'date_creation DESC',
'date_creation ASC',
'date_available DESC',
'date_available ASC'
'date_available ASC',
'natural_order DESC',
'natural_order ASC'
);
if (isset($_POST['simpleAutoOrder']) || isset($_POST['recursiveAutoOrder']) )
@@ -98,7 +100,7 @@ SELECT id, name, id_uppercat
array_multisort(
$sort,
SORT_REGULAR,
$order_by_field === "natural_order" ? SORT_NATURAL : SORT_REGULAR,
'ASC' == $order_by_asc ? SORT_ASC : SORT_DESC,
$categories
);