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 28, 2023
1 parent 221b698 commit c56fad7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 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,13 @@ 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)
->setUseSearchContext(true),
$editorsOptionsField = new OptionsetField(
"CanEditType",
_t(__CLASS__.'.EDITHEADER', "Who can edit this page?")
Expand All @@ -2310,11 +2313,13 @@ 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)
->setUseSearchContext(true)
)
)
);
Expand Down

0 comments on commit c56fad7

Please sign in to comment.