Changeset 1066 for trunk/admin


Ignore:
Timestamp:
Mar 7, 2006, 12:28:51 AM (19 years ago)
Author:
plg
Message:

request 302: order categories alphanumerically

alphanumerically sort of language keys in admin.lang.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_list.php

    r1064 r1066  
    9898  }
    9999}
     100// save manual category ordering
    100101else if (isset($_POST['submitOrder']))
    101102{
    102103  asort($_POST['catOrd'], SORT_NUMERIC);
    103104  save_categories_order(array_keys($_POST['catOrd']));
    104 }
     105
     106  array_push(
     107    $page['infos'],
     108    l10n('Categories manual order was saved')
     109    );
     110}
     111// sort categories alpha-numerically
     112else if (isset($_POST['submitOrderAlphaNum']))
     113{
     114  $query = '
     115SELECT id, name
     116  FROM '.CATEGORIES_TABLE.'
     117  WHERE id_uppercat '.
     118    (!isset($_GET['parent_id']) ? 'IS NULL' : '= '.$_GET['parent_id']).'
     119;';
     120  $result = pwg_query($query);
     121  while ($row = mysql_fetch_assoc($result))
     122  {
     123    $categories[ $row['id'] ] = $row['name'];
     124  }
     125
     126  asort($categories, SORT_REGULAR);
     127  save_categories_order(array_keys($categories));
     128
     129  array_push(
     130    $page['infos'],
     131    l10n('Categories ordered alphanumerically')
     132    );
     133}
     134
    105135// +-----------------------------------------------------------------------+
    106136// |                           Cache management                            |
Note: See TracChangeset for help on using the changeset viewer.