From 5b2cc197049c363c2d51e936b9b07dcc0868f290 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 15 Dec 2012 19:57:14 +0100 Subject: [PATCH] Added placeholder text to group listboxes --- code/model/SiteConfig.php | 21 ++++++++++++++++++--- code/model/SiteTree.php | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/code/model/SiteConfig.php b/code/model/SiteConfig.php index 0fff4f9f..c5e3d89e 100644 --- a/code/model/SiteConfig.php +++ b/code/model/SiteConfig.php @@ -58,13 +58,28 @@ class SiteConfig extends DataObject implements PermissionProvider { $tabAccess = new Tab('Access', $viewersOptionsField = new OptionsetField("CanViewType", _t('SiteConfig.VIEWHEADER', "Who can view pages on this site?")), $viewerGroupsField = ListboxField::create("ViewerGroups", _t('SiteTree.VIEWERGROUPS', "Viewer Groups")) - ->setMultiple(true)->setSource($groupsMap), + ->setMultiple(true) + ->setSource($groupsMap) + ->setAttribute( + 'data-placeholder', + _t('SiteTree.GroupPlaceholder', 'Click to select group') + ), $editorsOptionsField = new OptionsetField("CanEditType", _t('SiteConfig.EDITHEADER', "Who can edit pages on this site?")), $editorGroupsField = ListboxField::create("EditorGroups", _t('SiteTree.EDITORGROUPS', "Editor Groups")) - ->setMultiple(true)->setSource($groupsMap), + ->setMultiple(true) + ->setSource($groupsMap) + ->setAttribute( + 'data-placeholder', + _t('SiteTree.GroupPlaceholder', 'Click to select group') + ), $topLevelCreatorsOptionsField = new OptionsetField("CanCreateTopLevelType", _t('SiteConfig.TOPLEVELCREATE', "Who can create pages in the root of the site?")), $topLevelCreatorsGroupsField = ListboxField::create("CreateTopLevelGroups", _t('SiteTree.TOPLEVELCREATORGROUPS', "Top level creators")) - ->setMultiple(true)->setSource($groupsMap) + ->setMultiple(true) + ->setSource($groupsMap) + ->setAttribute( + 'data-placeholder', + _t('SiteTree.GroupPlaceholder', 'Click to select group') + ) ) ), new HiddenField('ID') diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 7f7bf33d..f37dfeb5 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1931,13 +1931,23 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid _t('SiteTree.ACCESSHEADER', "Who can view this page?") ), $viewerGroupsField = ListboxField::create("ViewerGroups", _t('SiteTree.VIEWERGROUPS', "Viewer Groups")) - ->setMultiple(true)->setSource($groupsMap), + ->setMultiple(true) + ->setSource($groupsMap) + ->setAttribute( + 'data-placeholder', + _t('SiteTree.GroupPlaceholder', 'Click to select group') + ), $editorsOptionsField = new OptionsetField( "CanEditType", _t('SiteTree.EDITHEADER', "Who can edit this page?") ), $editorGroupsField = ListboxField::create("EditorGroups", _t('SiteTree.EDITORGROUPS', "Editor Groups")) - ->setMultiple(true)->setSource($groupsMap) + ->setMultiple(true) + ->setSource($groupsMap) + ->setAttribute( + 'data-placeholder', + _t('SiteTree.GroupPlaceholder', 'Click to select group') + ) ) ) );