FEATURE: Virtual pages now copy allowed children from the page they are

pointing at. (from r85197)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89157 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-10-15 21:46:45 +00:00
parent d3ae7b1d7f
commit 88fd58dc69

View File

@ -48,6 +48,12 @@ class VirtualPage extends Page {
return $this->CopyContentFrom();
}
function allowedChildren() {
if($this->CopyContentFrom()) {
return $this->CopyContentFrom()->allowedChildren();
}
}
/**
* Generate the CMS fields from the fields from the original page.
@ -117,7 +123,7 @@ class VirtualPage extends Page {
*/
function copyFrom($source) {
if($source) {
foreach($this->getVirtualFields() AS $virtualField)
foreach($this->getVirtualFields() as $virtualField)
$this->$virtualField = $source->$virtualField;
}
}
@ -263,4 +269,4 @@ class VirtualPage_Controller extends Page_Controller {
}
}
?>
?>