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:
Ingo Schommer 2010-02-23 00:58:24 +00:00 committed by Sam Minnee
parent ebaf33c720
commit 0525e5f884
2 changed files with 46 additions and 8 deletions

View File

@ -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,

View File

@ -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