Permalink
Browse files

API CHANGE Restructured SiteTree->getCMSFields() tabs from "Root.Cont…

…ent.Main" to "Root.Main", merged "Root.Content.Metadata" tab into "Root.Main" (fixes #7261)
  • Loading branch information...
1 parent d15b4ad commit 42d404faa8fa3bb131ed46a2941953cce7949191 @chillu chillu committed May 9, 2012
Showing with 7 additions and 8 deletions.
  1. +7 −8 code/model/SiteTree.php
@@ -1836,10 +1836,8 @@ function getCMSFields() {
$tabMain = new Tab('Main',
new TextField("Title", $this->fieldLabel('Title')),
new TextField("MenuTitle", $this->fieldLabel('MenuTitle')),
- $htmlField = new HtmlEditorField("Content", _t('SiteTree.HTMLEDITORTITLE', "Content", 'HTML editor title'))
- ),
- $tabMeta = new Tab('Metadata',
$urlsegment,
+ $htmlField = new HtmlEditorField("Content", _t('SiteTree.HTMLEDITORTITLE', "Content", 'HTML editor title')),
new TextField("MetaTitle", $this->fieldLabel('MetaTitle')),
new TextareaField("MetaKeywords", $this->fieldLabel('MetaKeywords'), 1),
new TextareaField("MetaDescription", $this->fieldLabel('MetaDescription')),
@@ -1858,7 +1856,6 @@ function getCMSFields() {
else $fields->removeFieldFromTab('Root', 'Dependent');
$tabMain->setTitle(_t('SiteTree.TABCONTENT', "Main Content"));
- $tabMeta->setTitle(_t('SiteTree.TABMETA', "Metadata"));
if(file_exists(BASE_PATH . '/install.php')) {
$fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader",
@@ -1867,6 +1864,11 @@ function getCMSFields() {
. "</p>"), "Title");
}
+ // Backwards compat: Rewrite nested "Content" tabs to toplevel
+ $fields->setTabPathRewrites(array(
+ '/^Root\.Content\.Main$/' => 'Root.Main',
+ '/^Root\.Content\.([^.]+)$/' => 'Root.\\1',
+ ));
if(self::$runCMSFieldsExtensions) {
$this->extend('updateCMSFields', $fields);
@@ -1904,9 +1906,7 @@ function getSettingsFields() {
$visibility = new FieldGroup(
new CheckboxField("ShowInMenus", $this->fieldLabel('ShowInMenus')),
new CheckboxField("ShowInSearch", $this->fieldLabel('ShowInSearch'))
- )
- ),
- $tabAccess = new Tab('Access',
+ ),
$viewersOptionsField = new OptionsetField(
"CanViewType",
_t('SiteTree.ACCESSHEADER', "Who can view this page?")
@@ -1933,7 +1933,6 @@ function getSettingsFields() {
$parentTypeSelector->addExtraClass('parentTypeSelector');
$tabBehaviour->setTitle(_t('SiteTree.TABBEHAVIOUR', "Behavior"));
- $tabAccess->setTitle(_t('SiteTree.TABACCESS', "Access"));
// Make page location fields read-only if the user doesn't have the appropriate permission
if(!Permission::check("SITETREE_REORGANISE")) {

0 comments on commit 42d404f

Please sign in to comment.