本文整理匯總了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());
}