ENHANCEMENT: Added page location fields in the behaviour tab, as an alternative to drag and drop

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75814 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-05-01 03:02:41 +00:00
parent 2387bbcbc1
commit 98f7d9b644

View File

@ -1214,6 +1214,13 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$this->fieldLabel('ClassName'), $this->fieldLabel('ClassName'),
$this->getClassDropdown() $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'),
new CheckboxField("ShowInMenus", $this->fieldLabel('ShowInMenus')), new CheckboxField("ShowInMenus", $this->fieldLabel('ShowInMenus')),
new CheckboxField("ShowInSearch", $this->fieldLabel('ShowInSearch')), new CheckboxField("ShowInSearch", $this->fieldLabel('ShowInSearch')),
/*, new TreeMultiselectField("MultipleParents", "Page appears within", "SiteTree")*/ /*, new TreeMultiselectField("MultipleParents", "Page appears within", "SiteTree")*/
@ -1310,6 +1317,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$labels['MetaKeywords'] = _t('SiteTree.METAKEYWORDS', "Keywords"); $labels['MetaKeywords'] = _t('SiteTree.METAKEYWORDS', "Keywords");
$labels['ExtraMeta'] = _t('SiteTree.METAEXTRA', "Custom Meta Tags"); $labels['ExtraMeta'] = _t('SiteTree.METAEXTRA', "Custom Meta Tags");
$labels['ClassName'] = _t('SiteTree.PAGETYPE', "Page type", PR_MEDIUM, 'Classname of a page object'); $labels['ClassName'] = _t('SiteTree.PAGETYPE', "Page type", PR_MEDIUM, 'Classname of a page object');
$labels['ParentType'] = _t('SiteTree.PARENTTYPE', "Page location", PR_MEDIUM);
$labels['ParentID'] = _t('SiteTree.PARENTID', "Parent page", PR_MEDIUM);
$labels['ShowInMenus'] =_t('SiteTree.SHOWINMENUS', "Show in menus?"); $labels['ShowInMenus'] =_t('SiteTree.SHOWINMENUS', "Show in menus?");
$labels['ShowInSearch'] = _t('SiteTree.SHOWINSEARCH', "Show in search?"); $labels['ShowInSearch'] = _t('SiteTree.SHOWINSEARCH', "Show in search?");
$labels['ProvideComments'] = _t('SiteTree.ALLOWCOMMENTS', "Allow comments on this page?"); $labels['ProvideComments'] = _t('SiteTree.ALLOWCOMMENTS', "Allow comments on this page?");
@ -1879,5 +1888,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
return $entities; return $entities;
} }
function getParentType() {
return $this->ParentID == 0 ? 'root' : 'subpage';
}
} }
?> ?>