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