diff options
author | Gotcha <gotcha@piwigo.org> | 2010-03-07 21:09:26 +0000 |
---|---|---|
committer | Gotcha <gotcha@piwigo.org> | 2010-03-07 21:09:26 +0000 |
commit | 7b4f21b997358eda567de6a944776d43961da93c (patch) | |
tree | f4149df5fb353d945f7e5458b49a27744c74a56e /admin | |
parent | 7634e52e5655682f60f6f16bce66b74ddcf68bb0 (diff) |
Trunk merge r5076 from bug:1119
bug:1119
git-svn-id: http://piwigo.org/svn/trunk@5079 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/cat_list.php | 23 | ||||
-rw-r--r-- | admin/template/goto/cat_list.tpl | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/admin/cat_list.php b/admin/cat_list.php index 45eee0732..57abe3f85 100644 --- a/admin/cat_list.php +++ b/admin/cat_list.php @@ -132,6 +132,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 = pwg_db_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 | diff --git a/admin/template/goto/cat_list.tpl b/admin/template/goto/cat_list.tpl index 020e5cff1..379306592 100644 --- a/admin/template/goto/cat_list.tpl +++ b/admin/template/goto/cat_list.tpl @@ -41,6 +41,7 @@ <p> <input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED}> <input class="submit" name="submitOrderAlphaNum" type="submit" value="{'Order alphanumerically'|@translate}" {$TAG_INPUT_ENABLED}> + <input class="submit" name="submitOrderAlphaNumReverse" type="submit" value="{'Order alphanumerically reverse'|@translate}" {$TAG_INPUT_ENABLED}> </p> <ul class="categoryUl"> @@ -85,6 +86,7 @@ <p> <input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED}> <input class="submit" name="submitOrderAlphaNum" type="submit" value="{'Order alphanumerically'|@translate}" {$TAG_INPUT_ENABLED}> + <input class="submit" name="submitOrderAlphaNumReverse" type="submit" value="{'Order alphanumerically reverse'|@translate}" {$TAG_INPUT_ENABLED}> </p> </form> |