mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Localized strings in PermissionCheckboxSetField (from r99590)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99663 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ebaf33c720
commit
0525e5f884
@ -524,6 +524,22 @@ $lang['en_US']['Permission']['SINGULARNAME'] = array(
|
||||
50,
|
||||
'Singular name of the object, used in dropdowns and to generally identify a single object in the interface'
|
||||
);
|
||||
$lang['en_US']['PermissionCheckboxSetField']['AssignedTo'] = 'assigned to "%s"';
|
||||
$lang['en_US']['PermissionCheckboxSetField']['FromGroup'] = array(
|
||||
'inherited from group "%s"',
|
||||
PR_MEDIUM,
|
||||
'A permission inherited from a certain group'
|
||||
);
|
||||
$lang['en_US']['PermissionCheckboxSetField']['FromRole'] = array(
|
||||
'inherited from role "%s"',
|
||||
PR_MEDIUM,
|
||||
'A permission inherited from a certain permission role'
|
||||
);
|
||||
$lang['en_US']['PermissionCheckboxSetField']['FromRoleOnGroup'] = array(
|
||||
'inherited from role "%s" on group "%s"',
|
||||
PR_MEDIUM,
|
||||
'A permission inherited from a role on a certain group'
|
||||
);
|
||||
$lang['en_US']['PermissionRole']['PLURALNAME'] = array(
|
||||
'Permission Rols',
|
||||
50,
|
||||
|
@ -109,8 +109,15 @@ class PermissionCheckboxSetField extends FormField {
|
||||
foreach($record->Roles() as $role) {
|
||||
foreach($role->Codes() as $code) {
|
||||
if (!isset($inheritedCodes[$code->Code])) $inheritedCodes[$code->Code] = array();
|
||||
// TODO i18n
|
||||
$inheritedCodes[$code->Code][] = 'from role "'.$role->Title . '"';
|
||||
$inheritedCodes[$code->Code][] = sprintf(
|
||||
_t(
|
||||
'PermissionCheckboxSetField.FromRole',
|
||||
'inherited from role "%s"',
|
||||
PR_MEDIUM,
|
||||
'A permission inherited from a certain permission role'
|
||||
),
|
||||
$role->Title
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -124,16 +131,32 @@ class PermissionCheckboxSetField extends FormField {
|
||||
if ($role->Codes()) {
|
||||
foreach($role->Codes() as $code) {
|
||||
if (!isset($inheritedCodes[$code->Code])) $inheritedCodes[$code->Code] = array();
|
||||
// TODO i18n
|
||||
$inheritedCodes[$code->Code][] = 'role "'.$role->Title.'" on group "'.$parent->Title . '"';
|
||||
$inheritedCodes[$code->Code][] = sprintf(
|
||||
_t(
|
||||
'PermissionCheckboxSetField.FromRoleOnGroup',
|
||||
'inherited from role "%s" on group "%s"',
|
||||
PR_MEDIUM,
|
||||
'A permission inherited from a role on a certain group'
|
||||
),
|
||||
$role->Title,
|
||||
$parent->Title
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($parent->Permissions()->Count()) {
|
||||
foreach($parent->Permissions() as $permission) {
|
||||
if (!isset($inheritedCodes[$permission->Code])) $inheritedCodes[$permission->Code] = array();
|
||||
// TODO i18n
|
||||
$inheritedCodes[$permission->Code][] = 'group "'.$parent->Title . '"';
|
||||
$inheritedCodes[$permission->Code][] =
|
||||
sprintf(
|
||||
_t(
|
||||
'PermissionCheckboxSetField.FromGroup',
|
||||
'inherited from group "%s"',
|
||||
PR_MEDIUM,
|
||||
'A permission inherited from a certain group'
|
||||
),
|
||||
$parent->Title
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -163,8 +186,7 @@ class PermissionCheckboxSetField extends FormField {
|
||||
if (isset($inheritedCodes[$code])) {
|
||||
// disable inherited codes, as any saving logic would be too complicate to express in this interface
|
||||
$disabled = ' disabled="true"';
|
||||
// TODO i18n
|
||||
$inheritMessage = ' (inherited from ' . join(', ', $inheritedCodes[$code]) . ')';
|
||||
$inheritMessage = ' (' . join(', ', $inheritedCodes[$code]) . ')';
|
||||
} elseif($this->records && $this->records->Count() > 1 && isset($uninheritedCodes[$code])) {
|
||||
// If code assignments are collected from more than one "source group",
|
||||
// show its origin automatically
|
||||
|
Loading…
Reference in New Issue
Block a user