From 6ade4bc91b19e2ed9c5c9d1c406744b6da18e91d Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 17 Mar 2012 14:07:28 +0000 Subject: feature 2594: l10n on new strings of the "Album Permissions" screen. Details about "indirect permissions". git-svn-id: http://piwigo.org/svn/trunk@13593 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/cat_perm.php | 42 ++++++++++++++++-------------- admin/themes/default/template/cat_perm.tpl | 32 +++++++++++++++++++++++ language/en_UK/admin.lang.php | 9 +++++++ language/fr_FR/admin.lang.php | 9 +++++++ 4 files changed, 73 insertions(+), 19 deletions(-) diff --git a/admin/cat_perm.php b/admin/cat_perm.php index 7b555e3be..d5c41edf7 100644 --- a/admin/cat_perm.php +++ b/admin/cat_perm.php @@ -280,35 +280,39 @@ SELECT user_id, group_id } $user_granted_by_group_ids = array(); - + foreach ($granted_groups as $group_users) { - $user_granted_by_group_ids = array_merge($user_granted_by_group_ids, - $group_users); + $user_granted_by_group_ids = array_merge($user_granted_by_group_ids, $group_users); } - $user_granted_by_group_ids = array_unique($user_granted_by_group_ids); + $user_granted_by_group_ids = array_unique($user_granted_by_group_ids); - $user_granted_indirect_ids = array_diff($user_granted_by_group_ids, - $user_granted_direct_ids); - $user_granted_indirect_ids = - order_by_name($user_granted_indirect_ids, $users); - foreach ($user_granted_indirect_ids as $user_id) + $user_granted_indirect_ids = array_diff( + $user_granted_by_group_ids, + $user_granted_direct_ids + ); + + $template->assign('nb_users_granted_indirect', count($user_granted_indirect_ids)); + + foreach ($granted_groups as $group_id => $group_users) { - foreach ($granted_groups as $group_id => $group_users) + $group_usernames = array(); + foreach ($group_users as $user_id) { - if (in_array($user_id, $group_users)) + if (in_array($user_id, $user_granted_indirect_ids)) { - $template->append( - 'user_granted_indirects', - array( - 'USER'=>$users[$user_id], - 'GROUP'=>$groups[$group_id] - ) - ); - break; + array_push($group_usernames, $users[$user_id]); } } + + $template->append( + 'user_granted_indirect_groups', + array( + 'group_name' => $groups[$group_id], + 'group_users' => implode(', ', $group_usernames), + ) + ); } } diff --git a/admin/themes/default/template/cat_perm.tpl b/admin/themes/default/template/cat_perm.tpl index 728669894..718c7ba47 100644 --- a/admin/themes/default/template/cat_perm.tpl +++ b/admin/themes/default/template/cat_perm.tpl @@ -18,6 +18,20 @@ jQuery(document).ready(function() { jQuery("#selectStatus").change(function() { checkStatusOptions(); }); + + jQuery("#indirectPermissionsDetailsShow").click(function(){ + jQuery("#indirectPermissionsDetailsShow").hide(); + jQuery("#indirectPermissionsDetailsHide").show(); + jQuery("#indirectPermissionsDetails").show(); + return false; + }); + + jQuery("#indirectPermissionsDetailsHide").click(function(){ + jQuery("#indirectPermissionsDetailsShow").show(); + jQuery("#indirectPermissionsDetailsHide").hide(); + jQuery("#indirectPermissionsDetails").hide(); + return false; + }); }); {/literal}{/footer_script} @@ -41,11 +55,15 @@ jQuery(document).ready(function() { {'Groups and users'|@translate}

+{if count($groups) > 0} {'Permission granted for groups'|@translate}
+{else} + {'There is no group in this gallery.'|@translate} {'Group management'|@translate} +{/if}

@@ -56,6 +74,20 @@ jQuery(document).ready(function() {

+{if isset($nb_users_granted_indirect)} +

+ {'%u users have automatic permission because they belong to a granted group.'|@translate|@sprintf:$nb_users_granted_indirect} + + {'show details'|@translate} + +

+

+{/if} + {*

{'Groups'|@translate}

diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php index b355e96c5..1a0de75cd 100644 --- a/language/en_UK/admin.lang.php +++ b/language/en_UK/admin.lang.php @@ -864,4 +864,13 @@ $lang['ReGalAndroid (RemoteGallery client for Android) is an open source (GPL v3 $lang['Features include gallery browsing, album creation and photo upload.'] = 'Features include gallery browsing, album creation and photo upload.'; $lang['Generate multiple size images']='Generate multiple size images'; $lang['Delete multiple size images']='Delete multiple size images'; +$lang['any visitor can see this album'] = 'any visitor can see this album'; +$lang['visitors need to login and have the appropriate permissions to see this album'] = 'visitors need to login and have the appropriate permissions to see this album'; +$lang['Groups and users'] = 'Groups and users'; +$lang['Permission granted for groups'] = 'Permission granted for groups'; +$lang['Select groups...'] = 'Select groups...'; +$lang['There is no group in this gallery.'] = 'There is no group in this gallery.'; +$lang['Permission granted for users'] = 'Permission granted for users'; +$lang['Select users...'] = 'Select users...'; +$lang['%u users have automatic permission because they belong to a granted group.'] = '%u users have automatic permission because they belong to a granted group.'; ?> \ No newline at end of file diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php index 54c42756e..5b87ed512 100644 --- a/language/fr_FR/admin.lang.php +++ b/language/fr_FR/admin.lang.php @@ -879,4 +879,13 @@ $lang['Aperture is designed for professional photographers with iPhoto simplicit $lang['The Piwigo export plugin allows you to create albums and export photos.'] = 'Le plugin d\'export Piwigo vous permet de créer des albums et d\'y ajouter vos photos.'; $lang['ReGalAndroid (RemoteGallery client for Android) is an open source (GPL v3) Piwigo client for the Android platform.'] = 'ReGalAndroid (RemoteGallery Android) est un client libre (GPL v3) pour Piwigo sur Android.'; $lang['Features include gallery browsing, album creation and photo upload.'] = 'Ses fonctionnalités incluent la navigation sur la galerie, la création d\'albums et l\'ajout de photos.'; +$lang['any visitor can see this album'] = 'n\'importe quel visiteur peut voir cet album'; +$lang['visitors need to login and have the appropriate permissions to see this album'] = 'les visiteurs doivent se connecter et avoir les permissions nécessaires pour voir cet album'; +$lang['Groups and users'] = 'Groupes et utilisateurs'; +$lang['Permission granted for groups'] = 'Permission accordée pour les groupes'; +$lang['Select groups...'] = 'Sélectionnez les groupes...'; +$lang['There is no group in this gallery.'] = 'Il n\'y a pas de groupe dans cette galerie.'; +$lang['Permission granted for users'] = 'Permission accordée pour les utilisateurs'; +$lang['Select users...'] = 'Sélectionnez les utilisateurs...'; +$lang['%u users have automatic permission because they belong to a granted group.'] = '%u utilisateurs ont automatiquement la permission car ils appartiennent à un groupe autorisé.'; ?> \ No newline at end of file -- cgit v1.2.3