MINOR Enforce SiteTree::$allowed_children in tree drag'n'drop for VirtualPage originals

This commit is contained in:
Ingo Schommer 2012-01-14 12:55:17 +01:00
parent 9451993d74
commit a6cc7d8392

View File

@ -67,6 +67,9 @@
hintKey = newParentClass ? newParentClass : 'Root', hintKey = newParentClass ? newParentClass : 'Root',
hint = (typeof hints[hintKey] != 'undefined') ? hints[hintKey] : null; hint = (typeof hints[hintKey] != 'undefined') ? hints[hintKey] : null;
// Special case for VirtualPage: Check that original page type is an allowed child
if(hint && movedNode.attr('class').match(/VirtualPage-([^\s]*)/)) movedNodeClass = RegExp.$1;
if(hint) disallowedChildren = (typeof hint.disallowedChildren != 'undefined') ? hint.disallowedChildren : []; if(hint) disallowedChildren = (typeof hint.disallowedChildren != 'undefined') ? hint.disallowedChildren : [];
var isAllowed = ( var isAllowed = (
// Don't allow moving the root node // Don't allow moving the root node