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
);
@@ -72,6 +72,18 @@ var delay_autoOpen = {$delay_before_autoOpen}
<input type="radio" value="date_available ASC" name="order">
{'Date posted, old &rarr; new'|@translate}
</label>
<label class="font-checkbox">
<span class="icon-dot-circled"> </span>
<input type="radio" value="natural_order ASC" name="order">
{'Natural order, A &rarr; Z'|@translate}
</label>
<label class="font-checkbox">
<span class="icon-dot-circled"> </span>
<input type="radio" value="natural_order DESC" name="order">
{'Natural order, Z &rarr; A'|@translate}
</label>
</div>
<input type="submit" name="simpleAutoOrder" value="{'Apply to direct sub-albums'|@translate}"/>
<input type="submit" name="recursiveAutoOrder" value="{'Apply to the whole hierarchy'|@translate}"/>
+2
View File
@@ -415,4 +415,6 @@ $lang['Your authentication key is no longer valid.'] = 'Your authentication key
$lang['Invalid username or password!'] = 'Invalid username or password!';
$lang['generate random password'] = 'generate random password';
$lang['Related albums'] = 'Related albums';
$lang['Natural order, A &rarr; Z'] = 'Natural order, A &rarr; Z';
$lang['Natural order, Z &rarr; A'] = 'Natural order, Z &rarr; A';
?>
+3 -1
View File
@@ -413,4 +413,6 @@ $lang['Link: %s'] = 'Lien: %s';
$lang['Your authentication key is no longer valid.'] = 'Votre clef d\'identification n\'est plus valide.';
$lang['Invalid username or password!'] = 'Nom d\'utilisateur ou mot de passe invalide !';
$lang['generate random password'] = 'générer un mot de passe aléatoire';
$lang['Related albums'] = 'Albums liés';
$lang['Related albums'] = 'Albums liés';
$lang['Natural order, A &rarr; Z'] = 'Ordre naturel, A &rarr; Z';
$lang['Natural order, Z &rarr; A'] = 'Ordre naturel, Z &rarr; A';