Choose the sorting of the categories management

bug:1119

git-svn-id: http://piwigo.org/svn/branches/2.0@5076 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
Gotcha
2010-03-07 16:53:53 +00:00
parent 5f31dc10b5
commit 2aaed23c85
4 changed files with 33 additions and 4 deletions
+23
View File
@@ -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 |