Skip to content

Commit 539cdb5

Browse files
TheCadienOliver Kossin
authored and
Oliver Kossin
committed
[146][WIP] Rename Blacklist to Registration Rule
1 parent 5ed7416 commit 539cdb5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+477
-477
lines changed

Admin/CommunityAdmin.php

+32-32
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
*/
2828
class CommunityAdmin extends Admin
2929
{
30-
public const BLACKLIST_ITEM_SECURITY_CONTEXT = 'sulu.community.blacklist_items';
31-
public const BLACKLIST_ITEM_LIST_VIEW = 'sulu_community.blacklist_item';
32-
public const BLACKLIST_ITEM_ADD_FORM_VIEW = 'sulu_community.blacklist_item.add_form';
33-
public const BLACKLIST_ITEM_EDIT_FORM_VIEW = 'sulu_community.blacklist_item.edit_form';
30+
public const REGISTRATION_RULE_ITEM_SECURITY_CONTEXT = 'sulu.community.registration_rule_items';
31+
public const REGISTRATION_RULE_ITEM_LIST_VIEW = 'sulu_community.registration_rule_item';
32+
public const REGISTRATION_RULE_ITEM_ADD_FORM_VIEW = 'sulu_community.registration_rule_item.add_form';
33+
public const REGISTRATION_RULE_ITEM_EDIT_FORM_VIEW = 'sulu_community.registration_rule_item.edit_form';
3434

3535
/**
3636
* @var SecurityCheckerInterface
@@ -69,10 +69,10 @@ public function __construct(
6969

7070
public function configureNavigationItems(NavigationItemCollection $navigationItemCollection): void
7171
{
72-
if ($this->securityChecker->hasPermission(static::BLACKLIST_ITEM_SECURITY_CONTEXT, PermissionTypes::VIEW)) {
73-
$tags = new NavigationItem('sulu_community.blacklist');
72+
if ($this->securityChecker->hasPermission(static::REGISTRATION_RULE_ITEM_SECURITY_CONTEXT, PermissionTypes::VIEW)) {
73+
$tags = new NavigationItem('sulu_community.registration_rule');
7474
$tags->setPosition(40);
75-
$tags->setView(static::BLACKLIST_ITEM_LIST_VIEW);
75+
$tags->setView(static::REGISTRATION_RULE_ITEM_LIST_VIEW);
7676

7777
$navigationItemCollection->get(Admin::SETTINGS_NAVIGATION_ITEM)->addChild($tags);
7878
}
@@ -83,61 +83,61 @@ public function configureViews(ViewCollection $viewCollection): void
8383
$formToolbarActions = [];
8484
$listToolbarActions = [];
8585

86-
if ($this->securityChecker->hasPermission(static::BLACKLIST_ITEM_SECURITY_CONTEXT, PermissionTypes::ADD)) {
86+
if ($this->securityChecker->hasPermission(static::REGISTRATION_RULE_ITEM_SECURITY_CONTEXT, PermissionTypes::ADD)) {
8787
$listToolbarActions[] = new ToolbarAction('sulu_admin.add');
8888
}
8989

90-
if ($this->securityChecker->hasPermission(static::BLACKLIST_ITEM_SECURITY_CONTEXT, PermissionTypes::EDIT)) {
90+
if ($this->securityChecker->hasPermission(static::REGISTRATION_RULE_ITEM_SECURITY_CONTEXT, PermissionTypes::EDIT)) {
9191
$formToolbarActions[] = new ToolbarAction('sulu_admin.save');
9292
}
9393

94-
if ($this->securityChecker->hasPermission(static::BLACKLIST_ITEM_SECURITY_CONTEXT, PermissionTypes::DELETE)) {
94+
if ($this->securityChecker->hasPermission(static::REGISTRATION_RULE_ITEM_SECURITY_CONTEXT, PermissionTypes::DELETE)) {
9595
$formToolbarActions[] = new ToolbarAction('sulu_admin.delete');
9696
$listToolbarActions[] = new ToolbarAction('sulu_admin.delete');
9797
}
9898

99-
if ($this->securityChecker->hasPermission(static::BLACKLIST_ITEM_SECURITY_CONTEXT, PermissionTypes::VIEW)) {
99+
if ($this->securityChecker->hasPermission(static::REGISTRATION_RULE_ITEM_SECURITY_CONTEXT, PermissionTypes::VIEW)) {
100100
$listToolbarActions[] = new ToolbarAction('sulu_admin.export');
101101
}
102102

103-
if ($this->securityChecker->hasPermission(static::BLACKLIST_ITEM_SECURITY_CONTEXT, PermissionTypes::EDIT)) {
103+
if ($this->securityChecker->hasPermission(static::REGISTRATION_RULE_ITEM_SECURITY_CONTEXT, PermissionTypes::EDIT)) {
104104
$viewCollection->add(
105-
$this->viewBuilderFactory->createListViewBuilder(static::BLACKLIST_ITEM_LIST_VIEW, '/blacklist')
106-
->setResourceKey('blacklist_items')
107-
->setListKey('blacklist_items')
105+
$this->viewBuilderFactory->createListViewBuilder(static::REGISTRATION_RULE_ITEM_LIST_VIEW, '/blacklist')
106+
->setResourceKey('registration_rule_items')
107+
->setListKey('registration_rule_items')
108108
->setTitle('sulu_community.blacklist')
109109
->addListAdapters(['table'])
110-
->setAddView(static::BLACKLIST_ITEM_ADD_FORM_VIEW)
111-
->setEditView(static::BLACKLIST_ITEM_EDIT_FORM_VIEW)
110+
->setAddView(static::REGISTRATION_RULE_ITEM_ADD_FORM_VIEW)
111+
->setEditView(static::REGISTRATION_RULE_ITEM_EDIT_FORM_VIEW)
112112
->addToolbarActions($listToolbarActions)
113113
);
114114
$viewCollection->add(
115-
$this->viewBuilderFactory->createResourceTabViewBuilder(static::BLACKLIST_ITEM_ADD_FORM_VIEW, '/blacklist/add')
116-
->setResourceKey('blacklist_items')
117-
->setBackView(static::BLACKLIST_ITEM_LIST_VIEW)
115+
$this->viewBuilderFactory->createResourceTabViewBuilder(static::REGISTRATION_RULE_ITEM_ADD_FORM_VIEW, '/blacklist/add')
116+
->setResourceKey('registration_rule_items')
117+
->setBackView(static::REGISTRATION_RULE_ITEM_LIST_VIEW)
118118
);
119119
$viewCollection->add(
120-
$this->viewBuilderFactory->createFormViewBuilder(static::BLACKLIST_ITEM_ADD_FORM_VIEW . '.details', '/details')
121-
->setResourceKey('blacklist_items')
122-
->setFormKey('blacklist_item_details')
120+
$this->viewBuilderFactory->createFormViewBuilder(static::REGISTRATION_RULE_ITEM_ADD_FORM_VIEW . '.details', '/details')
121+
->setResourceKey('registration_rule_items')
122+
->setFormKey('registration_rule_item_details')
123123
->setTabTitle('sulu_admin.details')
124-
->setEditView(static::BLACKLIST_ITEM_EDIT_FORM_VIEW)
124+
->setEditView(static::REGISTRATION_RULE_ITEM_EDIT_FORM_VIEW)
125125
->addToolbarActions($formToolbarActions)
126-
->setParent(static::BLACKLIST_ITEM_ADD_FORM_VIEW)
126+
->setParent(static::REGISTRATION_RULE_ITEM_ADD_FORM_VIEW)
127127
);
128128
$viewCollection->add(
129-
$this->viewBuilderFactory->createResourceTabViewBuilder(static::BLACKLIST_ITEM_EDIT_FORM_VIEW, '/blacklist/:id')
130-
->setResourceKey('blacklist_items')
131-
->setBackView(static::BLACKLIST_ITEM_LIST_VIEW)
129+
$this->viewBuilderFactory->createResourceTabViewBuilder(static::REGISTRATION_RULE_ITEM_EDIT_FORM_VIEW, '/blacklist/:id')
130+
->setResourceKey('registration-rule-items')
131+
->setBackView(static::REGISTRATION_RULE_ITEM_LIST_VIEW)
132132
->setTitleProperty('name')
133133
);
134134
$viewCollection->add(
135-
$this->viewBuilderFactory->createFormViewBuilder(static::BLACKLIST_ITEM_EDIT_FORM_VIEW . '.details', '/details')
136-
->setResourceKey('blacklist_items')
135+
$this->viewBuilderFactory->createFormViewBuilder(static::REGISTRATION_RULE_ITEM_EDIT_FORM_VIEW . '.details', '/details')
136+
->setResourceKey('registration-rule-items')
137137
->setFormKey('blacklist_item_details')
138138
->setTabTitle('sulu_admin.details')
139139
->addToolbarActions($formToolbarActions)
140-
->setParent(static::BLACKLIST_ITEM_EDIT_FORM_VIEW)
140+
->setParent(static::REGISTRATION_RULE_ITEM_EDIT_FORM_VIEW)
141141
);
142142
}
143143
}
@@ -173,7 +173,7 @@ public function getSecurityContexts()
173173
[
174174
'Sulu' => [
175175
'Settings' => [
176-
self::BLACKLIST_ITEM_SECURITY_CONTEXT => [
176+
self::REGISTRATION_RULE_ITEM_SECURITY_CONTEXT => [
177177
PermissionTypes::VIEW,
178178
PermissionTypes::ADD,
179179
PermissionTypes::EDIT,

Controller/BlacklistConfirmationController.php

-144
This file was deleted.

0 commit comments

Comments
 (0)