From 88fd58dc69448fcc9add7b268d29ff4149a90217 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 15 Oct 2009 21:46:45 +0000 Subject: [PATCH] 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 --- core/model/VirtualPage.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/model/VirtualPage.php b/core/model/VirtualPage.php index 0498b213c..a720ecfad 100755 --- a/core/model/VirtualPage.php +++ b/core/model/VirtualPage.php @@ -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 { } } -?> \ No newline at end of file +?>