aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_perm.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2012-03-17 14:07:28 +0000
committerplegall <plg@piwigo.org>2012-03-17 14:07:28 +0000
commit6ade4bc91b19e2ed9c5c9d1c406744b6da18e91d (patch)
tree529b728ed3075fbdd97c022c6400ae58e6b506c6 /admin/cat_perm.php
parent73c16385635a0f3c35159b2c270a889c45a47216 (diff)
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
Diffstat (limited to 'admin/cat_perm.php')
-rw-r--r--admin/cat_perm.php42
1 files changed, 23 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),
+ )
+ );
}
}