Changeset 5076


Ignore:
Timestamp:
Mar 7, 2010, 5:53:53 PM (11 years ago)
Author:
Gotcha
Message:

Choose the sorting of the categories management
bug:1119

Location:
branches/2.0
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/admin/cat_list.php

    r5003 r5076  
    140140    );
    141141}
     142// sort categories alpha-numerically reverse
     143else if (isset($_POST['submitOrderAlphaNumReverse']))
     144{
     145  $query = '
     146SELECT id, name
     147  FROM '.CATEGORIES_TABLE.'
     148  WHERE id_uppercat '.
     149    (!isset($_GET['parent_id']) ? 'IS NULL' : '= '.$_GET['parent_id']).'
     150;';
     151  $result = pwg_query($query);
     152  while ($row = mysql_fetch_assoc($result))
     153  {
     154    $categories[ $row['id'] ] = strtolower($row['name']);
     155  }
     156
     157  arsort($categories, SORT_REGULAR);
     158  save_categories_order(array_keys($categories));
     159
     160  array_push(
     161    $page['infos'],
     162    l10n('Categories ordered alphanumerically reverse')
     163    );
     164}
    142165
    143166// +-----------------------------------------------------------------------+
  • branches/2.0/admin/template/goto/cat_list.tpl

    r4505 r5076  
    4545    <input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED} />
    4646    <input class="submit" name="submitOrderAlphaNum" type="submit" value="{'Order alphanumerically'|@translate}" {$TAG_INPUT_ENABLED} />
     47        <input class="submit" name="submitOrderAlphaNumReverse" type="submit" value="{'Order alphanumerically reverse'|@translate}" {$TAG_INPUT_ENABLED} />
    4748  </p>
    4849  <ul class="categoryUl">
     
    8990    <input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED} />
    9091    <input class="submit" name="submitOrderAlphaNum" type="submit" value="{'Order alphanumerically'|@translate}" {$TAG_INPUT_ENABLED} />
     92        <input class="submit" name="submitOrderAlphaNumReverse" type="submit" value="{'Order alphanumerically reverse'|@translate}" {$TAG_INPUT_ENABLED} />
    9193  </p>
    9294
  • branches/2.0/language/en_UK/admin.lang.php

    r5070 r5076  
    6767$lang['Categories authorized thanks to group associations'] = 'Categories authorized thanks to group associations';
    6868$lang['Categories manual order was saved'] = 'Categories manual order was saved';
    69 $lang['Categories ordered alphanumerically'] = 'Categories ordered alphanumerically';
     69$lang['Categories ordered alphanumerically'] = 'Categories ascending alphanumerically ordered';
     70$lang['Categories ordered alphanumerically reverse'] = 'Categories descending alphanumerically ordered';
    7071$lang['Category elements associated to the following categories: %s'] = 'Category elements associated to the following categories: %s';
    7172$lang['Check for upgrade failed for unknown reasons.'] = 'Check for upgrade failed for unknown reasons.';
     
    132133$lang['Operating system'] = 'Operating system';
    133134$lang['Options'] = 'Options';
    134 $lang['Order alphanumerically'] = 'Order alphanumerically';
     135$lang['Order alphanumerically'] = 'Categories sorted in ascending order &dArr;';
     136$lang['Order alphanumerically inverse'] = 'Categories sorted in descending order &uArr;';
    135137$lang['Other private categories'] = 'Other private categories';
    136138$lang['Page banner'] = 'Page banner';
  • branches/2.0/language/fr_FR/admin.lang.php

    r5070 r5076  
    6767$lang['Categories authorized thanks to group associations'] = 'Catégories accessibles grâce à l\'appartenance aux groupes';
    6868$lang['Categories manual order was saved'] = 'L\'ordre manuel des catégories a été sauvegardé';
    69 $lang['Categories ordered alphanumerically'] = 'Catégories ordonnées alphabético-numériquement';
     69$lang['Categories ordered alphanumerically'] = 'Catégories triées par ordre croissant alphabético-numériquement.';
     70$lang['Categories ordered alphanumerically reverse'] = 'Catégories triées par ordre décroissant alphabético-numériquement.';
    7071$lang['Category elements associated to the following categories: %s'] = 'Les éléments de la catégorie ont été associés aux catégories suivantes : %s';
    7172$lang['Check for upgrade failed for unknown reasons.'] = 'La vérification de la dernière version sur le serveur a échouée pour une raison inconnue.';
     
    132133$lang['Operating system'] = 'Système d\'exploitation';
    133134$lang['Options'] = 'Options';
    134 $lang['Order alphanumerically'] = 'Ordonner alphabético-numériquement';
     135$lang['Order alphanumerically'] = 'Trier par ordre croissant &dArr;';
     136$lang['Order alphanumerically reverse'] = 'Trier par ordre décroissant &uArr;';
    135137$lang['Other private categories'] = 'Autres catégories privées';
    136138$lang['Page banner'] = 'Bannière des pages';
Note: See TracChangeset for help on using the changeset viewer.