diff --git a/core/model/SiteConfig.php b/core/model/SiteConfig.php index 3553d58ee..ab2931886 100644 --- a/core/model/SiteConfig.php +++ b/core/model/SiteConfig.php @@ -155,9 +155,9 @@ class SiteConfig extends DataObject implements PermissionProvider { function providePermissions() { return array( 'EDIT_SITECONFIG' => array( - 'name' => 'Manage site configuration', - 'category' => 'Roles and access permissions', - 'help' => 'Ability to edit global access settings/top-level page permissions.', + 'name' => _t('SiteConfig.EDIT_PERMISSION', 'Manage site configuration'), + 'category' => _t('Permissions.PERMISSIONS_CATEGORY', 'Roles and access permissions'), + 'help' => _t('SiteConfig.EDIT_PERMISSION_HELP', 'Ability to edit global access settings/top-level page permissions.'), 'sort' => 400 ) ); diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 41b6f4716..df90ba731 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -2333,24 +2333,24 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid return array( 'SITETREE_GRANT_ACCESS' => array( 'name' => _t('SiteTree.PERMISSION_GRANTACCESS_DESCRIPTION', 'Manage access rights for content'), - 'category' => 'Roles and access permissions', + 'category' => _t('Permissions.PERMISSIONS_CATEGORY', 'Roles and access permissions'), 'sort' => 100 ), 'SITETREE_VIEW_ALL' => array( 'name' => _t('SiteTree.VIEW_ALL_DESCRIPTION', 'View any page'), - 'category' => 'Content permissions', + 'category' => _t('Permissions.CONTENT_CATEGORY', 'Content permissions'), 'sort' => -100, - 'help' => 'Ability to view any page on the site, regardless of the settings on the Access tab. Requires "Access to Site Content."' + 'help' => _t('SiteTree.VIEW_ALL_HELP', 'Ability to view any page on the site, regardless of the settings on the Access tab. Requires "Access to Site Content."') ), 'SITETREE_EDIT_ALL' => array( 'name' => _t('SiteTree.EDIT_ALL_DESCRIPTION', 'Edit any page'), - 'category' => 'Content permissions', + 'category' => _t('Permissions.CONTENT_CATEGORY', 'Content permissions'), 'sort' => -50, - 'help' => 'Ability to edit any page on the site, regardless of the settings on the Access tab. Requires "Access to Site Content."' + 'help' => _t('SiteTree.EDIT_ALL_HELP', 'Ability to edit any page on the site, regardless of the settings on the Access tab. Requires "Access to Site Content."') ), 'SITETREE_REORGANISE' => array( 'name' => _t('SiteTree.REORGANISE_DESCRIPTION', 'Change site structure'), - 'category' => 'Content permissions', + 'category' => _t('Permissions.CONTENT_CATEGORY', 'Content permissions'), 'sort' => 100 ) ); diff --git a/lang/en_US.php b/lang/en_US.php index a2ad68e1c..46249fb6f 100644 --- a/lang/en_US.php +++ b/lang/en_US.php @@ -555,6 +555,8 @@ $lang['en_US']['PermissionRoleCode']['SINGULARNAME'] = array( 50, 'Singular name of the object, used in dropdowns and to generally identify a single object in the interface' ); +$lang['en_US']['Permissions']['CONTENT_CATEGORY'] = 'Content permissions'; +$lang['en_US']['Permissions']['PERMISSIONS_CATEGORY'] = 'Roles and access permissions'; $lang['en_US']['PhoneNumberField']['VALIDATION'] = 'Please enter a valid phone number'; $lang['en_US']['QueuedEmail']['PLURALNAME'] = array( 'Queued Emails', @@ -649,6 +651,8 @@ $lang['en_US']['SecurityAdmin']['ROLES'] = 'Roles'; $lang['en_US']['SecurityAdmin']['ROLESDESCRIPTION'] = 'This section allows you to add roles to this group. Roles are logical groupings of permissions, which can be editied in the Roles tab'; $lang['en_US']['SecurityAdmin']['VIEWUSER'] = 'View User'; $lang['en_US']['SimpleImageField']['NOUPLOAD'] = 'No Image Uploaded'; +$lang['en_US']['SiteConfig']['EDIT_PERMISSION'] = 'Manage site configuration'; +$lang['en_US']['SiteConfig']['EDIT_PERMISSION_HELP'] = 'Ability to edit global access settings/top-level page permissions.'; $lang['en_US']['SiteConfig']['PLURALNAME'] = array( 'Site Configs', 50, @@ -694,6 +698,7 @@ $lang['en_US']['SiteTree']['EDITHEADER'] = 'Who can edit this page?'; $lang['en_US']['SiteTree']['EDITONLYTHESE'] = 'Only these people (choose from list)'; $lang['en_US']['SiteTree']['EDITORGROUPS'] = 'Editor Groups'; $lang['en_US']['SiteTree']['EDIT_ALL_DESCRIPTION'] = 'Edit any page'; +$lang['en_US']['SiteTree']['EDIT_ALL_HELP'] = 'Ability to edit any page on the site, regardless of the settings on the Access tab. Requires "Access to Site Content."'; $lang['en_US']['SiteTree']['Editors'] = 'Editors Groups'; $lang['en_US']['SiteTree']['HASBROKENLINKS'] = 'This page has broken links.'; $lang['en_US']['SiteTree']['HOMEPAGEFORDOMAIN'] = array( @@ -770,6 +775,7 @@ $lang['en_US']['SiteTree']['VALIDATIONURLSEGMENT1'] = 'Another page is using tha $lang['en_US']['SiteTree']['VALIDATIONURLSEGMENT2'] = 'URLs can only be made up of letters, digits and hyphens.'; $lang['en_US']['SiteTree']['VIEWERGROUPS'] = 'Viewer Groups'; $lang['en_US']['SiteTree']['VIEW_ALL_DESCRIPTION'] = 'View any page'; +$lang['en_US']['SiteTree']['VIEW_ALL_HELP'] = 'Ability to view any page on the site, regardless of the settings on the Access tab. Requires "Access to Site Content."'; $lang['en_US']['SiteTree']['Viewers'] = 'Viewers Groups'; $lang['en_US']['SiteTree']['has_one_Parent'] = array( 'Parent Page', diff --git a/security/Permission.php b/security/Permission.php index ce9f1e7af..7f37e050d 100755 --- a/security/Permission.php +++ b/security/Permission.php @@ -501,12 +501,12 @@ class Permission extends DataObject { foreach($someCodes as $k => $v) { if (is_array($v)) { // There must be a category and name key. - if (!isset($v['category'])) user_error("The permission $k must have a category key", E_USER_WARNING); + if (!isset($v[Two])) user_error("The permission $k must have a category key", E_USER_WARNING); if (!isset($v['name'])) user_error("The permission $k must have a name key", E_USER_WARNING); - if (!isset($allCodes[$v['category']])) $allCodes[$v['category']] = array(); + if (!isset($allCodes[$v[Two]])) $allCodes[$v[Two]] = array(); - $allCodes[$v['category']][$k] = array( + $allCodes[$v[Two]][$k] = array( 'name' => $v['name'], 'help' => isset($v['help']) ? $v['help'] : null, 'sort' => isset($v['sort']) ? $v['sort'] : 0