ENHANCEMENT Allow selection of parent page with adding page through URL - Ticket #3177. Thanks simon_w!

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@69864 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-01-08 00:16:54 +00:00 committed by Sam Minnee
parent 3351aef184
commit c247db5146

View File

@ -450,6 +450,10 @@ JS;
$parent = isset($_REQUEST['ParentID']) ? $_REQUEST['ParentID'] : 0;
$suffix = isset($_REQUEST['Suffix']) ? "-" . $_REQUEST['Suffix'] : null;
if(!$parent && isset($_REQUEST['Parent'])) {
$page = SiteTree::get_by_url($_REQUEST['Parent']);
if($page) $parent = $page->ID;
}
if(is_numeric($parent)) $parentObj = DataObject::get_by_id("SiteTree", $parent);
if(!$parentObj || !$parentObj->ID) $parent = 0;