本文整理汇总了PHP中eZContentOperationCollection::swapNode方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentOperationCollection::swapNode方法的具体用法?PHP eZContentOperationCollection::swapNode怎么用?PHP eZContentOperationCollection::swapNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentOperationCollection
的用法示例。
在下文中一共展示了eZContentOperationCollection::swapNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if (!$nodeParent || !$selectedNodeParent) {
return $module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel', array());
}
if (!$nodeParent->canMoveTo($selectedObjectClassID)) {
eZDebug::writeError("Cannot move an object of class {$selectedObjectClassID} to node {$nodeParentNodeID} (no create permission)");
return $module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel', array());
}
if (!$selectedNodeParent->canMoveTo($objectClassID)) {
eZDebug::writeError("Cannot move an object of class {$objectClassID} to node {$selectedNodeParentNodeID} (no create permission)");
return $module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel', array());
}
// exchange contentobject ids and versions.
if (eZOperationHandler::operationIsAvailable('content_swap')) {
$operationResult = eZOperationHandler::execute('content', 'swap', array('node_id' => $nodeID, 'selected_node_id' => $selectedNodeID, 'node_id_list' => array($nodeID, $selectedNodeID)), null, true);
} else {
eZContentOperationCollection::swapNode($nodeID, $selectedNodeID, array($nodeID, $selectedNodeID));
}
return $module->redirectToView('view', array($viewMode, $nodeID, $languageCode));
} else {
if ($module->isCurrentAction('SwapNodeRequest')) {
/* This action brings a browse screen up to select with which the selected
* node should be swapped. It will not actually move the nodes. */
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) {
return $module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel', array());
}