mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
FIX replaced magic config() calls to use the config::get()
This commit is contained in:
parent
0b5b71c0fb
commit
7823b40b57
@ -54,8 +54,8 @@ For example in BlogPost:
|
|||||||
|
|
||||||
```php
|
```php
|
||||||
protected function getCandidateAuthors() {
|
protected function getCandidateAuthors() {
|
||||||
if($this->config()->restrict_authors_to_group) {
|
if($this->config()->get('restrict_authors_to_group')) {
|
||||||
return Group::get()->filter('Code', $this->config()->restrict_authors_to_group)->first()->Members();
|
return Group::get()->filter('Code', $this->config()->get('restrict_authors_to_group'))->first()->Members();
|
||||||
} else {
|
} else {
|
||||||
$list = Member::get();
|
$list = Member::get();
|
||||||
$this->extend('updateCandidateAuthors', $list);
|
$this->extend('updateCandidateAuthors', $list);
|
||||||
|
@ -425,13 +425,13 @@ class Blog extends Page implements PermissionProvider
|
|||||||
*/
|
*/
|
||||||
protected function getCandidateUsers()
|
protected function getCandidateUsers()
|
||||||
{
|
{
|
||||||
if ($this->config()->grant_user_access) {
|
if ($this->config()->get('grant_user_access')) {
|
||||||
$list = Member::get();
|
$list = Member::get();
|
||||||
$this->extend('updateCandidateUsers', $list);
|
$this->extend('updateCandidateUsers', $list);
|
||||||
return $list;
|
return $list;
|
||||||
} else {
|
} else {
|
||||||
return Permission::get_members_by_permission(
|
return Permission::get_members_by_permission(
|
||||||
$this->config()->grant_user_permission
|
$this->config()->get('grant_user_permission')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -636,7 +636,7 @@ class Blog extends Page implements PermissionProvider
|
|||||||
*/
|
*/
|
||||||
protected function assignGroup()
|
protected function assignGroup()
|
||||||
{
|
{
|
||||||
if (!$this->config()->grant_user_access) {
|
if (!$this->config()->get('grant_user_access')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -661,7 +661,7 @@ class Blog extends Page implements PermissionProvider
|
|||||||
*/
|
*/
|
||||||
protected function getUserGroup()
|
protected function getUserGroup()
|
||||||
{
|
{
|
||||||
$code = $this->config()->grant_user_group;
|
$code = $this->config()->get('grant_user_group');
|
||||||
|
|
||||||
$group = Group::get()->filter('Code', $code)->first();
|
$group = Group::get()->filter('Code', $code)->first();
|
||||||
|
|
||||||
@ -676,7 +676,7 @@ class Blog extends Page implements PermissionProvider
|
|||||||
$group->write();
|
$group->write();
|
||||||
|
|
||||||
$permission = Permission::create();
|
$permission = Permission::create();
|
||||||
$permission->Code = $this->config()->grant_user_permission;
|
$permission->Code = $this->config()->get('grant_user_permission');
|
||||||
|
|
||||||
$group->Permissions()->add($permission);
|
$group->Permissions()->add($permission);
|
||||||
|
|
||||||
|
@ -338,8 +338,8 @@ class BlogPost extends Page
|
|||||||
*/
|
*/
|
||||||
public function getCandidateAuthors()
|
public function getCandidateAuthors()
|
||||||
{
|
{
|
||||||
if ($this->config()->restrict_authors_to_group) {
|
if ($this->config()->get('restrict_authors_to_group')) {
|
||||||
return Group::get()->filter('Code', $this->config()->restrict_authors_to_group)->first()->Members();
|
return Group::get()->filter('Code', $this->config()->get('restrict_authors_to_group'))->first()->Members();
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = Member::get();
|
$list = Member::get();
|
||||||
|
Loading…
Reference in New Issue
Block a user