Permalink
Browse files

MINOR Wrapping ParentType selector in its own CompositeField in SiteT…

…ree->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
  • Loading branch information...
chillu committed Nov 21, 2009
1 parent f3c0cbc commit b661b40865057f221db8f4918e4d1ba024a087be
Showing with 10 additions and 7 deletions.
  1. +10 −7 core/model/SiteTree.php
View
@@ -1651,13 +1651,14 @@ function getCMSFields() {
$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 @@ function getCMSFields() {
$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);

0 comments on commit b661b40

Please sign in to comment.