mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-09 10:13:00 +02:00
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
This commit is contained in:
+23
-19
@@ -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_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),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
<legend>{'Groups and users'|@translate}</legend>
|
||||
|
||||
<p>
|
||||
{if count($groups) > 0}
|
||||
<strong>{'Permission granted for groups'|@translate}</strong>
|
||||
<br>
|
||||
<select data-placeholder="{'Select groups...'|@translate}" class="chzn-select" multiple style="width:700px;" name="groups[]">
|
||||
{html_options options=$groups selected=$groups_selected}
|
||||
</select>
|
||||
{else}
|
||||
{'There is no group in this gallery.'|@translate} <a href="admin.php?page=group_list" class="externalLink">{'Group management'|@translate}</a>
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -56,6 +74,20 @@ jQuery(document).ready(function() {
|
||||
</select>
|
||||
</p>
|
||||
|
||||
{if isset($nb_users_granted_indirect)}
|
||||
<p>
|
||||
{'%u users have automatic permission because they belong to a granted group.'|@translate|@sprintf:$nb_users_granted_indirect}
|
||||
<a href="#" id="indirectPermissionsDetailsHide" style="display:none">{'hide details'|@translate}</a>
|
||||
<a href="#" id="indirectPermissionsDetailsShow">{'show details'|@translate}</a>
|
||||
|
||||
<ul id="indirectPermissionsDetails" style="display:none">
|
||||
{foreach from=$user_granted_indirect_groups item=group_details}
|
||||
<li><strong>{$group_details.group_name}</strong> : {$group_details.group_users}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
{*
|
||||
<h4>{'Groups'|@translate}</h4>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user