aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_list.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/cat_list.php')
-rw-r--r--admin/cat_list.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/admin/cat_list.php b/admin/cat_list.php
index 426293e7f..7f4d3540c 100644
--- a/admin/cat_list.php
+++ b/admin/cat_list.php
@@ -139,6 +139,29 @@ SELECT id, name
l10n('Categories ordered alphanumerically')
);
}
+// sort categories alpha-numerically reverse
+else if (isset($_POST['submitOrderAlphaNumReverse']))
+{
+ $query = '
+SELECT id, name
+ FROM '.CATEGORIES_TABLE.'
+ WHERE id_uppercat '.
+ (!isset($_GET['parent_id']) ? 'IS NULL' : '= '.$_GET['parent_id']).'
+;';
+ $result = pwg_query($query);
+ while ($row = mysql_fetch_assoc($result))
+ {
+ $categories[ $row['id'] ] = strtolower($row['name']);
+ }
+
+ arsort($categories, SORT_REGULAR);
+ save_categories_order(array_keys($categories));
+
+ array_push(
+ $page['infos'],
+ l10n('Categories ordered alphanumerically reverse')
+ );
+}
// +-----------------------------------------------------------------------+
// | Navigation path |