mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
d3ae7b1d7f
commit
88fd58dc69
@ -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 {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user