if (!$selectedNode->canMoveTo($classID)) {
eZDebug::writeError("Cannot move node {$nodeID} as child of parent node {$selectedNodeID}, the current user does not have create permission for class ID {$classID}", 'content/action');
return $module->redirectToView('view', array('full', 2));
}
// Check if we try to move the node as child of itself or one of its children
if (in_array($node->attribute('node_id'), $selectedNode->pathArray())) {
eZDebug::writeError("Cannot move node {$nodeID} as child of itself or one of its own children (node {$selectedNodeID}).", 'content/action');
return $module->redirectToView('view', array('full', $node->attribute('node_id')));
}
}
// move selected nodes, this should probably be inside a transaction
foreach ($nodeToMoveList as $nodeToMove) {
if (eZOperationHandler::operationIsAvailable('content_move')) {
$operationResult = eZOperationHandler::execute('content', 'move', array('node_id' => $nodeToMove['node_id'], 'object_id' => $nodeToMove['object_id'], 'new_parent_node_id' => $selectedNodeID), null, true);
} else {
eZContentOperationCollection::moveNode($nodeToMove['node_id'], $nodeToMove['object_id'], $selectedNodeID);
}
}
return $module->redirectToView('view', array($viewMode, $selectedNodeID, $languageCode));
} else {
if ($module->isCurrentAction('MoveNodeRequest')) {
/* This action is started through the pop-up menu when a "Move" is
* requested and through the use of the "Move" button. It will start the
* browser to select where the node should be moved to. */
if (!$module->hasActionParameter('NodeID')) {
eZDebug::writeError("Missing NodeID parameter for action " . $module->currentAction(), 'content/action');
return $module->redirectToView('view', array('full', 2));
}
$nodeID = $module->actionParameter('NodeID');
$node = eZContentObjectTreeNode::fetch($nodeID);
if (!$node) {