From b661b40865057f221db8f4918e4d1ba024a087be Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 02:31:33 +0000 Subject: [PATCH] MINOR Wrapping ParentType selector in its own CompositeField in SiteTree->getCMSFields() to make it easier to apply javascript behaviour to git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92536 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 1c1f240ea..2485712dc 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1651,13 +1651,14 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $this->fieldLabel('ClassName'), $this->getClassDropdown() ), - - new OptionsetField("ParentType", "Page location", array( - "root" => _t("SiteTree.PARENTTYPE_ROOT", "Top-level page"), - "subpage" => _t("SiteTree.PARENTTYPE_SUBPAGE", "Sub-page underneath a parent page (choose below)"), - )), - new TreeDropdownField("ParentID", $this->fieldLabel('ParentID'), 'SiteTree'), - + $parentIdComposite = new CompositeField( + new OptionsetField("ParentType", "Page location", array( + "root" => _t("SiteTree.PARENTTYPE_ROOT", "Top-level page"), + "subpage" => _t("SiteTree.PARENTTYPE_SUBPAGE", "Sub-page underneath a parent page (choose below)"), + )), + new TreeDropdownField("ParentID", $this->fieldLabel('ParentID'), 'SiteTree') + ), + new CheckboxField("ShowInMenus", $this->fieldLabel('ShowInMenus')), new CheckboxField("ShowInSearch", $this->fieldLabel('ShowInSearch')), /*, new TreeMultiselectField("MultipleParents", "Page appears within", "SiteTree")*/ @@ -1715,6 +1716,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $editorsOptionsSource["LoggedInUsers"] = _t('SiteTree.EDITANYONE', "Anyone who can log-in to the CMS"); $editorsOptionsSource["OnlyTheseUsers"] = _t('SiteTree.EDITONLYTHESE', "Only these people (choose from list)"); $editorsOptionsField->setSource($editorsOptionsSource); + + $parentIdComposite->addExtraClass('parentTypeSelector'); if(!Permission::check('SITETREE_GRANT_ACCESS')) { $fields->makeFieldReadonly($viewersOptionsField);