Skip to content

Commit

Permalink
request 302: order categories alphanumerically
Browse files Browse the repository at this point in the history
alphanumerically sort of language keys in admin.lang.php


git-svn-id: http://piwigo.org/svn/trunk@1066 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Mar 6, 2006
1 parent 8615119 commit 53d78c9
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 40 deletions.
30 changes: 30 additions & 0 deletions admin/cat_list.php
Expand Up @@ -97,11 +97,41 @@ function save_categories_order($categories)
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 |
// +-----------------------------------------------------------------------+
Expand Down
41 changes: 22 additions & 19 deletions language/en_UK.iso-8859-1/admin.lang.php
Expand Up @@ -51,6 +51,8 @@
$lang['Caddie management'] = 'Caddie management';
$lang['Caddie'] = 'Caddie';
$lang['Categories authorized thanks to group associations'] = 'Categories authorized thanks to group associations';
$lang['Categories manual order was saved'] = 'Categories manual order was saved';
$lang['Categories ordered alphanumerically'] = 'Categories ordered alphanumerically';
$lang['Check for upgrade failed for unknown reasons.'] = 'Check for upgrade failed for unknown reasons.';
$lang['Check for upgrade'] = 'Check for upgrade';
$lang['Comments for all'] = 'Comments for all';
Expand Down Expand Up @@ -106,6 +108,7 @@
$lang['Only private categories are listed'] = 'Only private categories are listed';
$lang['Operating system'] = 'Operating system';
$lang['Options'] = 'Options';
$lang['Order alphanumerically'] = 'Order alphanumerically';
$lang['Order by'] = 'Order by';
$lang['Other private categories'] = 'Other private categories';
$lang['Parent category'] = 'Parent category';
Expand All @@ -121,8 +124,8 @@
$lang['Properties'] = 'Properties';
$lang['Random picture'] = 'Random picture';
$lang['Rate date'] = 'Rate date';
$lang['Rating'] = 'Rating';
$lang['Rating by guests'] = 'Rating by guests';
$lang['Rating'] = 'Rating';
$lang['Recent period'] = 'Recent period';
$lang['Registration date'] = 'Registration date';
$lang['Reject All'] = 'Reject All';
Expand All @@ -135,9 +138,9 @@
$lang['Select at least one category'] = 'Select at least one category';
$lang['Select at least one picture'] = 'Select at least one picture';
$lang['Select at least one user'] = 'Select at least one user';
$lang['Site manager'] = 'Site manager';
$lang['Show info'] = 'Show info';
$lang['Show number of comments'] = 'Show number of comments';
$lang['Site manager'] = 'Site manager';
$lang['Status'] = 'Status';
$lang['Storage category'] = 'Storage category';
$lang['Submit'] = 'Submit';
Expand Down Expand Up @@ -229,6 +232,21 @@
$lang['metadata_exif'] = 'EXIF';
$lang['metadata_iptc'] = 'IPTC';
$lang['name'] = 'name';
$lang['nbm_%d mails were not sended.'] = '%d mails were not sended.';
$lang['nbm_%d mails were sended.'] = '%d mails were sended.';
$lang['nbm_Error when sending email to %s [%s].'] = 'Error when sending email to %s [%s].';
$lang['nbm_Go to %s %s.'] = 'Go to %s %s.';
$lang['nbm_Hello %s'] = 'Hello %s';
$lang['nbm_Mail sended to %s [%s].'] = 'Mail sended to %s [%s].';
$lang['nbm_New elements added'] = 'New elements added';
$lang['nbm_New elements were added between %s and %s:'] = 'New elements were added between %s and %s:';
$lang['nbm_New elements were added on %s:'] = 'New elements were added on %s:';
$lang['nbm_No mail to send.'] = 'No mail to send.';
$lang['nbm_No user to send notifications by mail.'] = 'No user to send notifications by mail.';
$lang['nbm_Send mail to users'] = 'Send mail to users';
$lang['nbm_To unsubscribe send a message to %s.'] = 'To unsubscribe send a message to %s.';
$lang['nbm_User %s [%s] added.'] = 'User %s [%s] added.';
$lang['nbm_item_notification'] = 'Notification';
$lang['no_write_access'] = 'no write access';
$lang['order_by'] = 'order by';
$lang['path'] = 'path';
Expand Down Expand Up @@ -335,15 +353,15 @@
$lang['update_cats_subset'] = 'reduce to single existing categories';
$lang['update_default_title'] = 'Choose an option';
$lang['update_display_info'] = 'display maximum informations (added categories and elements, deleted categories and elements)';
$lang['update_missing_file_or_dir'] = 'File/directory read error';
$lang['update_missing_file_or_dir_info'] = 'The file or directory cannot be accessed (either it does not exist or the access is denied)';
$lang['update_err_pwg_version_differs'] = 'PhpWebGallery version differs on the remote site';
$lang['update_err_pwg_version_differs_info'] = 'Version of create_listing_file.php on the remote site and PhpWebGallery must be the same';
$lang['update_err_remote_listing_not_found'] = 'listing.xml file was not found';
$lang['update_err_remote_listing_not_found_info'] = 'listing.xml file was not found on the remote site. This file is generated by choosing the "generate listing" command in the Site manager';
$lang['update_error_list_title'] = 'Error list';
$lang['update_errors_caption'] = 'Errors caption';
$lang['update_infos_title'] = 'Detailed informations';
$lang['update_missing_file_or_dir'] = 'File/directory read error';
$lang['update_missing_file_or_dir_info'] = 'The file or directory cannot be accessed (either it does not exist or the access is denied)';
$lang['update_missing_tn_info'] = 'a picture filetype requires a thumbnail. The thumbnail must be present in the sub-directory "thumbnail" of the category directory. The thumbnail filename must start with the configured thumbnail prefix and the extension must be among the following list :';
$lang['update_missing_tn_short'] = 'missing thumbnail';
$lang['update_nb_del_categories'] = 'categories deleted in the database';
Expand Down Expand Up @@ -381,19 +399,4 @@
$lang['visitors'] = 'Visitors';
$lang['w_day'] = 'Day';
$lang['waiting'] = 'Waiting';
$lang['nbm_item_notification'] = 'Notification';
$lang['nbm_User %s [%s] added.'] = 'User %s [%s] added.';
$lang['nbm_New elements added'] = 'New elements added';
$lang['nbm_Hello %s'] = 'Hello %s';
$lang['nbm_New elements were added between %s and %s:'] = 'New elements were added between %s and %s:';
$lang['nbm_New elements were added on %s:'] = 'New elements were added on %s:';
$lang['nbm_Go to %s %s.'] = 'Go to %s %s.';
$lang['nbm_To unsubscribe send a message to %s.'] = 'To unsubscribe send a message to %s.';
$lang['nbm_Mail sended to %s [%s].'] = 'Mail sended to %s [%s].';
$lang['nbm_Error when sending email to %s [%s].'] = 'Error when sending email to %s [%s].';
$lang['nbm_%d mails were not sended.'] = '%d mails were not sended.';
$lang['nbm_No mail to send.'] = 'No mail to send.';
$lang['nbm_%d mails were sended.'] = '%d mails were sended.';
$lang['nbm_No user to send notifications by mail.'] = 'No user to send notifications by mail.';
$lang['nbm_Send mail to users'] = 'Send mail to users';
?>
41 changes: 22 additions & 19 deletions language/fr_FR.iso-8859-1/admin.lang.php
Expand Up @@ -51,6 +51,8 @@
$lang['Caddie management'] = 'Gestion du panier';
$lang['Caddie'] = 'Panier';
$lang['Categories authorized thanks to group associations'] = 'Catégories accessibles grâce à l\'appartenance aux groupes';
$lang['Categories manual order was saved'] = 'L\'ordre manuel des catégories a été sauvegardé';
$lang['Categories ordered alphanumerically'] = 'Catégories ordonnées alphabético-numériquement';
$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.';
$lang['Check for upgrade'] = 'Dernière version ?';
$lang['Comments for all'] = 'Commentaires utilisateur pour tous';
Expand Down Expand Up @@ -106,6 +108,7 @@
$lang['Only private categories are listed'] = 'Seules les catégories privées sont listées';
$lang['Operating system'] = 'System d\'exploitation';
$lang['Options'] = 'Options';
$lang['Order alphanumerically'] = 'Ordonner alphabético-numériquement';
$lang['Order by'] = 'Trier selon';
$lang['Other private categories'] = 'Autres catégories privées';
$lang['Parent category'] = 'Catégorie parente';
Expand All @@ -121,8 +124,8 @@
$lang['Properties'] = 'Propriétés';
$lang['Random picture'] = 'Au hasard';
$lang['Rate date'] = 'Date de notation';
$lang['Rating'] = 'Notation';
$lang['Rating by guests'] = 'Notation par les visiteurs';
$lang['Rating'] = 'Notation';
$lang['Recent period'] = 'Période récente';
$lang['Registration date'] = 'Date d\'enregistrement';
$lang['Reject All'] = 'Tout rejeter';
Expand All @@ -135,9 +138,9 @@
$lang['Select at least one category'] = 'Sélectionner au moins une catégorie';
$lang['Select at least one picture'] = 'Sélectionner au moins une image';
$lang['Select at least one user'] = 'Séléctionner au moins un utilisateur';
$lang['Site manager'] = 'Gestionnaire des sites';
$lang['Show info'] = 'Montrer les informations';
$lang['Show number of comments'] = 'Montrer le nombre de commentaires';
$lang['Site manager'] = 'Gestionnaire des sites';
$lang['Status'] = 'Statut';
$lang['Storage category'] = 'Catégorie de stockage';
$lang['Submit'] = 'Valider';
Expand Down Expand Up @@ -229,6 +232,21 @@
$lang['metadata_exif'] = 'EXIF';
$lang['metadata_iptc'] = 'IPTC';
$lang['name'] = 'nom';
$lang['nbm_%d mails were not sended.'] = '%s mails n\'ont pas été envoyés.';
$lang['nbm_%d mails were sended.'] = '%s mails ont été envoyés.';
$lang['nbm_Error when sending email to %s [%s].'] = 'Erreur lors de l\'envoi du mail à %s [%s].';
$lang['nbm_Go to %s %s.'] = 'Allez sur %s %s.';
$lang['nbm_Hello %s'] = 'Bonjour %s';
$lang['nbm_Mail sended to %s [%s].'] = 'Mail envoyé à %s [%s].';
$lang['nbm_New elements added'] = 'Nouveaux éléments ajoutés';
$lang['nbm_New elements were added between %s and %s:'] = 'Des nouveaux éléments ont été ajoutés entre le %s et le %s:';
$lang['nbm_New elements were added on %s:'] = 'Des nouveaux éléments ont été ajoutés le %s:';
$lang['nbm_No mail to send.'] = 'Pas de mail à envoyer.';
$lang['nbm_No user to send notifications by mail.'] = 'Pas d\'utilisateur pour envoyer des notifications par mails.';
$lang['nbm_Send mail to users'] = 'Envoi de mail aux utilisateurs';
$lang['nbm_To unsubscribe send a message to %s.'] = 'Pour vous désinscrire, envoyer un mail à %s.';
$lang['nbm_User %s [%s] added.'] = 'Utilisateur %s [%s] ajouté.';
$lang['nbm_item_notification'] = 'Notification';
$lang['no_write_access'] = 'pas d\'accès en écriture';
$lang['order_by'] = 'trier selon';
$lang['path'] = 'chemin';
Expand Down Expand Up @@ -335,15 +353,15 @@
$lang['update_cats_subset'] = 'traiter uniquement une catégorie';
$lang['update_default_title'] = 'Choisir une option';
$lang['update_display_info'] = 'afficher un maximum d\'informations (catégories ajoutées, éléments ajoutés, catégories et éléments supprimés)';
$lang['update_missing_file_or_dir'] = 'Erreur d\'ouverture fichier/répertoire';
$lang['update_missing_file_or_dir_info'] = 'Le fichier ou répertoire ne peut pas être accede (soit il n\'existe pas, soit l\'accés est refusé)';
$lang['update_err_pwg_version_differs'] = 'La version PhpWebGallery sur le site distant est differente';
$lang['update_err_pwg_version_differs_info'] = 'La version de create_listing_file.php sur le site distant et PhpWebGallery doit être la même';
$lang['update_err_remote_listing_not_found'] = 'le fichier listing.xml est introuvable';
$lang['update_err_remote_listing_not_found_info'] = 'le fichier listing.xml est introuvable sur le site distant. Ce fichier est generé en choisissant la commande "générer le listing" dans le gestionnaire de sites';
$lang['update_error_list_title'] = 'Liste des erreurs';
$lang['update_errors_caption'] = 'Légende des erreurs';
$lang['update_infos_title'] = 'Informations détaillées';
$lang['update_missing_file_or_dir'] = 'Erreur d\'ouverture fichier/répertoire';
$lang['update_missing_file_or_dir_info'] = 'Le fichier ou répertoire ne peut pas être accede (soit il n\'existe pas, soit l\'accés est refusé)';
$lang['update_missing_tn_info'] = 'Chaque fichier image requiert une miniature. La miniature doit être présente dans le sous-répertoire "thumbnail" du répertoire de la catégorie. Le nom du fichier de la miniature doit commencer avec le paramètre de configuration "prefix_thumbnail" et l\'extension du nom du fichier doit être parmi la liste suivante :';
$lang['update_missing_tn_short'] = 'miniature manquante';
$lang['update_nb_del_categories'] = 'catégories supprimées de la base de données';
Expand Down Expand Up @@ -381,19 +399,4 @@
$lang['visitors'] = 'Visiteurs';
$lang['w_day'] = 'Jour';
$lang['waiting'] = 'En attente';
$lang['nbm_item_notification'] = 'Notification';
$lang['nbm_User %s [%s] added.'] = 'Utilisateur %s [%s] ajouté.';
$lang['nbm_New elements added'] = 'Nouveaux éléments ajoutés';
$lang['nbm_Hello %s'] = 'Bonjour %s';
$lang['nbm_New elements were added between %s and %s:'] = 'Des nouveaux éléments ont été ajoutés entre le %s et le %s:';
$lang['nbm_New elements were added on %s:'] = 'Des nouveaux éléments ont été ajoutés le %s:';
$lang['nbm_Go to %s %s.'] = 'Allez sur %s %s.';
$lang['nbm_To unsubscribe send a message to %s.'] = 'Pour vous désinscrire, envoyer un mail à %s.';
$lang['nbm_Mail sended to %s [%s].'] = 'Mail envoyé à %s [%s].';
$lang['nbm_Error when sending email to %s [%s].'] = 'Erreur lors de l\'envoi du mail à %s [%s].';
$lang['nbm_%d mails were not sended.'] = '%s mails n\'ont pas été envoyés.';
$lang['nbm_No mail to send.'] = 'Pas de mail à envoyer.';
$lang['nbm_%d mails were sended.'] = '%s mails ont été envoyés.';
$lang['nbm_No user to send notifications by mail.'] = 'Pas d\'utilisateur pour envoyer des notifications par mails.';
$lang['nbm_Send mail to users'] = 'Envoi de mail aux utilisateurs';
?>
7 changes: 5 additions & 2 deletions template/yoga/admin/cat_list.tpl
Expand Up @@ -3,7 +3,7 @@

<h3>{CATEGORIES_NAV}</h3>

<form id="categoryOrdering" action="" method="post">
<form id="categoryOrdering" action="{F_ACTION}" method="post">

<ul class="categoryUl">

Expand Down Expand Up @@ -38,7 +38,10 @@
<!-- END category -->

</ul>
<p><input name="submitOrder" type="submit" value="{lang:Save order}" /></p>
<p>
<input name="submitOrder" type="submit" value="{lang:Save order}" />
<input name="submitOrderAlphaNum" type="submit" value="{lang:Order alphanumerically}" />
</p>

</form>

Expand Down

0 comments on commit 53d78c9

Please sign in to comment.