mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR: update PageTypes to use updated tab path for CMS fields. Fixes #6811
This commit is contained in:
parent
9540e248e7
commit
e17b4a185a
@ -225,22 +225,31 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
|
||||
foreach($classes as $class) {
|
||||
$obj = singleton($class);
|
||||
|
||||
if($obj instanceof HiddenClass) continue;
|
||||
|
||||
$allowedChildren = $obj->allowedChildren();
|
||||
|
||||
// SiteTree::allowedChildren() returns null rather than an empty array if SiteTree::allowed_chldren == 'none'
|
||||
if($allowedChildren == null) $allowedChildren = array();
|
||||
|
||||
$def[$class]['disallowedChildren'] = array_keys(array_diff($classes, $allowedChildren));
|
||||
|
||||
$defaultChild = $obj->defaultChild();
|
||||
if ($defaultChild != 'Page' && $defaultChild != null) $def[$class]['defaultChild'] = $defaultChild;
|
||||
|
||||
$defaultParent = isset(SiteTree::get_by_link($obj->defaultParent())->ID) ? SiteTree::get_by_link($obj->defaultParent())->ID : null;
|
||||
if($defaultChild != 'Page' && $defaultChild != null)
|
||||
$def[$class]['defaultChild'] = $defaultChild;
|
||||
|
||||
$id = SiteTree::get_by_link($obj->defaultParent())->ID;
|
||||
$defaultParent = $id ? SiteTree::get_by_link($obj->defaultParent())->ID : null;
|
||||
|
||||
if ($defaultParent != 1 && $defaultParent != null) $def[$class]['defaultParent'] = $defaultParent;
|
||||
|
||||
if(is_array($def[$class]['disallowedChildren'])) foreach($def[$class]['disallowedChildren'] as $disallowedChild) {
|
||||
if(is_array($def[$class]['disallowedChildren'])) {
|
||||
foreach($def[$class]['disallowedChildren'] as $disallowedChild) {
|
||||
$def[$disallowedChild]['disallowedParents'][] = $class;
|
||||
}
|
||||
}
|
||||
|
||||
// Are any classes allowed to be parents of root?
|
||||
$def['Root']['disallowedParents'][] = $class;
|
||||
|
@ -133,7 +133,7 @@ class ErrorPage extends Page {
|
||||
$fields = parent::getCMSFields();
|
||||
|
||||
$fields->addFieldToTab(
|
||||
"Root.Content",
|
||||
"Root.Main",
|
||||
new DropdownField(
|
||||
"ErrorCode",
|
||||
$this->fieldLabel('ErrorCode'),
|
||||
|
@ -128,7 +128,7 @@ class RedirectorPage extends Page {
|
||||
$fields->removeByName('MetaDescription');
|
||||
$fields->removeByName('ExtraMeta');
|
||||
|
||||
$fields->addFieldsToTab('Root.Content',
|
||||
$fields->addFieldsToTab('Root.Main',
|
||||
array(
|
||||
new HeaderField('RedirectorDescHeader',_t('RedirectorPage.HEADER', "This page will redirect users to another page")),
|
||||
new OptionsetField(
|
||||
|
@ -172,17 +172,17 @@ class VirtualPage extends Page {
|
||||
}
|
||||
|
||||
// Add fields to the tab
|
||||
$fields->addFieldToTab("Root.Content",
|
||||
$fields->addFieldToTab("Root.Main",
|
||||
new HeaderField('VirtualPageHeader',_t('VirtualPage.HEADER', "This is a virtual page")),
|
||||
"Title"
|
||||
);
|
||||
$fields->addFieldToTab("Root.Content", $copyContentFromField, "Title");
|
||||
$fields->addFieldToTab("Root.Main", $copyContentFromField, "Title");
|
||||
|
||||
// Create links back to the original object in the CMS
|
||||
if($this->CopyContentFrom()->ID) {
|
||||
$linkToContent = "<a class=\"cmsEditlink\" href=\"admin/show/$this->CopyContentFromID\">" .
|
||||
_t('VirtualPage.EDITCONTENT', 'click here to edit the content') . "</a>";
|
||||
$fields->addFieldToTab("Root.Content",
|
||||
$fields->addFieldToTab("Root.Main",
|
||||
$linkToContentLabelField = new LabelField('VirtualPageContentLinkLabel', $linkToContent),
|
||||
"Title"
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user