From 53d78c95b04b8c1be7a8d6534a358622160060b8 Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 6 Mar 2006 23:28:51 +0000 Subject: request 302: order categories alphanumerically alphanumerically sort of language keys in admin.lang.php git-svn-id: http://piwigo.org/svn/trunk@1066 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/cat_list.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'admin/cat_list.php') diff --git a/admin/cat_list.php b/admin/cat_list.php index 0c350ea00..bd15c8de7 100644 --- a/admin/cat_list.php +++ b/admin/cat_list.php @@ -97,11 +97,41 @@ else if (isset($_POST['submitAdd'])) array_push($page['infos'], $output_create['info']); } } +// save manual category ordering else if (isset($_POST['submitOrder'])) { asort($_POST['catOrd'], SORT_NUMERIC); save_categories_order(array_keys($_POST['catOrd'])); + + array_push( + $page['infos'], + l10n('Categories manual order was saved') + ); } +// sort categories alpha-numerically +else if (isset($_POST['submitOrderAlphaNum'])) +{ + $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'] ] = $row['name']; + } + + asort($categories, SORT_REGULAR); + save_categories_order(array_keys($categories)); + + array_push( + $page['infos'], + l10n('Categories ordered alphanumerically') + ); +} + // +-----------------------------------------------------------------------+ // | Cache management | // +-----------------------------------------------------------------------+ -- cgit v1.2.3