@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | public function populateDefaults() |
| 74 | 74 | { |
| 75 | - $this->Title = _t(self::class . '.SITENAMEDEFAULT', "Your Site Name"); |
|
| 76 | - $this->Tagline = _t(self::class . '.TAGLINEDEFAULT', "your tagline here"); |
|
| 75 | + $this->Title = _t(self::class.'.SITENAMEDEFAULT', "Your Site Name"); |
|
| 76 | + $this->Tagline = _t(self::class.'.TAGLINEDEFAULT', "your tagline here"); |
|
| 77 | 77 | |
| 78 | 78 | // Allow these defaults to be overridden |
| 79 | 79 | parent::populateDefaults(); |
@@ -88,35 +88,35 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function getCMSFields() |
| 90 | 90 | { |
| 91 | - $mapFn = function ($groups = []) { |
|
| 92 | - $map = []; |
|
| 91 | + $mapFn = function($groups = [ ]) { |
|
| 92 | + $map = [ ]; |
|
| 93 | 93 | foreach ($groups as $group) { |
| 94 | 94 | // Listboxfield values are escaped, use ASCII char instead of » |
| 95 | - $map[$group->ID] = $group->getBreadcrumbs(' > '); |
|
| 95 | + $map[ $group->ID ] = $group->getBreadcrumbs(' > '); |
|
| 96 | 96 | } |
| 97 | 97 | asort($map); |
| 98 | 98 | return $map; |
| 99 | 99 | }; |
| 100 | 100 | $groupsMap = $mapFn(Group::get()); |
| 101 | - $viewAllGroupsMap = $mapFn(Permission::get_groups_by_permission(['SITETREE_VIEW_ALL', 'ADMIN'])); |
|
| 102 | - $editAllGroupsMap = $mapFn(Permission::get_groups_by_permission(['SITETREE_EDIT_ALL', 'ADMIN'])); |
|
| 101 | + $viewAllGroupsMap = $mapFn(Permission::get_groups_by_permission([ 'SITETREE_VIEW_ALL', 'ADMIN' ])); |
|
| 102 | + $editAllGroupsMap = $mapFn(Permission::get_groups_by_permission([ 'SITETREE_EDIT_ALL', 'ADMIN' ])); |
|
| 103 | 103 | |
| 104 | 104 | $fields = FieldList::create( |
| 105 | 105 | TabSet::create( |
| 106 | 106 | "Root", |
| 107 | 107 | $tabMain = Tab::create( |
| 108 | 108 | 'Main', |
| 109 | - $titleField = TextField::create("Title", _t(self::class . '.SITETITLE', "Site title")), |
|
| 109 | + $titleField = TextField::create("Title", _t(self::class.'.SITETITLE', "Site title")), |
|
| 110 | 110 | $taglineField = TextField::create( |
| 111 | 111 | "Tagline", |
| 112 | - _t(self::class . '.SITETAGLINE', "Site Tagline/Slogan") |
|
| 112 | + _t(self::class.'.SITETAGLINE', "Site Tagline/Slogan") |
|
| 113 | 113 | ) |
| 114 | 114 | ), |
| 115 | 115 | $tabAccess = Tab::create( |
| 116 | 116 | 'Access', |
| 117 | 117 | $viewersOptionsField = OptionsetField::create( |
| 118 | 118 | "CanViewType", |
| 119 | - _t(self::class . '.VIEWHEADER', "Who can view pages on this site?") |
|
| 119 | + _t(self::class.'.VIEWHEADER', "Who can view pages on this site?") |
|
| 120 | 120 | ), |
| 121 | 121 | $viewerGroupsField = ListboxField::create( |
| 122 | 122 | "ViewerGroups", |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | ), |
| 130 | 130 | $editorsOptionsField = OptionsetField::create( |
| 131 | 131 | "CanEditType", |
| 132 | - _t(self::class . '.EDITHEADER', "Who can edit pages on this site?") |
|
| 132 | + _t(self::class.'.EDITHEADER', "Who can edit pages on this site?") |
|
| 133 | 133 | ), |
| 134 | 134 | $editorGroupsField = ListboxField::create( |
| 135 | 135 | "EditorGroups", |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | ), |
| 143 | 143 | $topLevelCreatorsOptionsField = OptionsetField::create( |
| 144 | 144 | "CanCreateTopLevelType", |
| 145 | - _t(self::class . '.TOPLEVELCREATE', "Who can create pages in the root of the site?") |
|
| 145 | + _t(self::class.'.TOPLEVELCREATE', "Who can create pages in the root of the site?") |
|
| 146 | 146 | ), |
| 147 | 147 | $topLevelCreatorsGroupsField = ListboxField::create( |
| 148 | 148 | "CreateTopLevelGroups", |
| 149 | - _t(self::class . '.TOPLEVELCREATORGROUPS', "Top level creators") |
|
| 149 | + _t(self::class.'.TOPLEVELCREATORGROUPS', "Top level creators") |
|
| 150 | 150 | ) |
| 151 | 151 | ->setSource($groupsMap) |
| 152 | 152 | ->setAttribute( |
@@ -158,13 +158,13 @@ discard block |
||
| 158 | 158 | HiddenField::create('ID') |
| 159 | 159 | ); |
| 160 | 160 | |
| 161 | - $viewersOptionsSource = []; |
|
| 162 | - $viewersOptionsSource["Anyone"] = _t('SilverStripe\\CMS\\Model\\SiteTree.ACCESSANYONE', "Anyone"); |
|
| 163 | - $viewersOptionsSource["LoggedInUsers"] = _t( |
|
| 161 | + $viewersOptionsSource = [ ]; |
|
| 162 | + $viewersOptionsSource[ "Anyone" ] = _t('SilverStripe\\CMS\\Model\\SiteTree.ACCESSANYONE', "Anyone"); |
|
| 163 | + $viewersOptionsSource[ "LoggedInUsers" ] = _t( |
|
| 164 | 164 | 'SilverStripe\\CMS\\Model\\SiteTree.ACCESSLOGGEDIN', |
| 165 | 165 | "Logged-in users" |
| 166 | 166 | ); |
| 167 | - $viewersOptionsSource["OnlyTheseUsers"] = _t( |
|
| 167 | + $viewersOptionsSource[ "OnlyTheseUsers" ] = _t( |
|
| 168 | 168 | 'SilverStripe\\CMS\\Model\\SiteTree.ACCESSONLYTHESE', |
| 169 | 169 | "Only these groups (choose from list)" |
| 170 | 170 | ); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $viewerGroupsField->setDescription(_t( |
| 175 | 175 | 'SilverStripe\\CMS\\Model\\SiteTree.VIEWER_GROUPS_FIELD_DESC', |
| 176 | 176 | 'Groups with global view permissions: {groupList}', |
| 177 | - ['groupList' => implode(', ', array_values($viewAllGroupsMap))] |
|
| 177 | + [ 'groupList' => implode(', ', array_values($viewAllGroupsMap)) ] |
|
| 178 | 178 | )); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -182,16 +182,16 @@ discard block |
||
| 182 | 182 | $editorGroupsField->setDescription(_t( |
| 183 | 183 | 'SilverStripe\\CMS\\Model\\SiteTree.EDITOR_GROUPS_FIELD_DESC', |
| 184 | 184 | 'Groups with global edit permissions: {groupList}', |
| 185 | - ['groupList' => implode(', ', array_values($editAllGroupsMap))] |
|
| 185 | + [ 'groupList' => implode(', ', array_values($editAllGroupsMap)) ] |
|
| 186 | 186 | )); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $editorsOptionsSource = []; |
|
| 190 | - $editorsOptionsSource["LoggedInUsers"] = _t( |
|
| 189 | + $editorsOptionsSource = [ ]; |
|
| 190 | + $editorsOptionsSource[ "LoggedInUsers" ] = _t( |
|
| 191 | 191 | 'SilverStripe\\CMS\\Model\\SiteTree.EDITANYONE', |
| 192 | 192 | "Anyone who can log-in to the CMS" |
| 193 | 193 | ); |
| 194 | - $editorsOptionsSource["OnlyTheseUsers"] = _t( |
|
| 194 | + $editorsOptionsSource[ "OnlyTheseUsers" ] = _t( |
|
| 195 | 195 | 'SilverStripe\\CMS\\Model\\SiteTree.EDITONLYTHESE', |
| 196 | 196 | "Only these groups (choose from list)" |
| 197 | 197 | ); |
@@ -210,22 +210,22 @@ discard block |
||
| 210 | 210 | $fields->makeFieldReadonly($titleField); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - if (file_exists(BASE_PATH . '/install.php')) { |
|
| 213 | + if (file_exists(BASE_PATH.'/install.php')) { |
|
| 214 | 214 | $fields->addFieldToTab( |
| 215 | 215 | 'Root.Main', |
| 216 | 216 | LiteralField::create( |
| 217 | 217 | 'InstallWarningHeader', |
| 218 | - '<div class="alert alert-warning">' . _t( |
|
| 218 | + '<div class="alert alert-warning">'._t( |
|
| 219 | 219 | 'SilverStripe\\CMS\\Model\\SiteTree.REMOVE_INSTALL_WARNING', |
| 220 | 220 | 'Warning: You should remove install.php from this SilverStripe install for security reasons.' |
| 221 | - ) . '</div>' |
|
| 221 | + ).'</div>' |
|
| 222 | 222 | ), |
| 223 | 223 | 'Title' |
| 224 | 224 | ); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - $tabMain->setTitle(_t(self::class . '.TABMAIN', "Main")); |
|
| 228 | - $tabAccess->setTitle(_t(self::class . '.TABACCESS', "Access")); |
|
| 227 | + $tabMain->setTitle(_t(self::class.'.TABMAIN', "Main")); |
|
| 228 | + $tabAccess->setTitle(_t(self::class.'.TABACCESS', "Access")); |
|
| 229 | 229 | $this->extend('updateCMSFields', $fields); |
| 230 | 230 | |
| 231 | 231 | return $fields; |
@@ -432,13 +432,13 @@ discard block |
||
| 432 | 432 | { |
| 433 | 433 | return [ |
| 434 | 434 | 'EDIT_SITECONFIG' => [ |
| 435 | - 'name' => _t(self::class . '.EDIT_PERMISSION', 'Manage site configuration'), |
|
| 435 | + 'name' => _t(self::class.'.EDIT_PERMISSION', 'Manage site configuration'), |
|
| 436 | 436 | 'category' => _t( |
| 437 | 437 | 'SilverStripe\\Security\\Permission.PERMISSIONS_CATEGORY', |
| 438 | 438 | 'Roles and access permissions' |
| 439 | 439 | ), |
| 440 | 440 | 'help' => _t( |
| 441 | - self::class . '.EDIT_PERMISSION_HELP', |
|
| 441 | + self::class.'.EDIT_PERMISSION_HELP', |
|
| 442 | 442 | 'Ability to edit global access settings/top-level page permissions.' |
| 443 | 443 | ), |
| 444 | 444 | 'sort' => 400 |