Skip to content

Commit

Permalink
ENH Use SearchableMutliDropdownField to select Members
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Nov 23, 2023
1 parent 221b698 commit b371c34
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions code/Model/SiteTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use SilverStripe\Forms\ListboxField;
use SilverStripe\Forms\LiteralField;
use SilverStripe\Forms\OptionsetField;
use SilverStripe\Forms\SearchableMultiDropdownField;
use SilverStripe\Forms\Tab;
use SilverStripe\Forms\TabSet;
use SilverStripe\Forms\TextareaField;
Expand Down Expand Up @@ -2296,11 +2297,12 @@ public function getSettingsFields()
_t(__CLASS__.'.VIEWERGROUPS', "Viewer Groups"),
Group::class
),
$viewerMembersField = ListboxField::create(
$viewerMembersField = SearchableMultiDropdownField::create(
"ViewerMembers",
_t(__CLASS__.'.VIEWERMEMBERS', "Viewer Users"),
$membersMap,
),
Member::get(),
)
->setIsLazyLoaded(true),
$editorsOptionsField = new OptionsetField(
"CanEditType",
_t(__CLASS__.'.EDITHEADER', "Who can edit this page?")
Expand All @@ -2310,11 +2312,12 @@ public function getSettingsFields()
_t(__CLASS__.'.EDITORGROUPS', "Editor Groups"),
Group::class
),
$editorMembersField = ListboxField::create(
$editorMembersField = SearchableMultiDropdownField::create(
"EditorMembers",
_t(__CLASS__.'.EDITORMEMBERS', "Editor Users"),
$membersMap
Member::get()
)
->setIsLazyLoaded(true)
)
)
);
Expand Down

0 comments on commit b371c34

Please sign in to comment.