Exemplo n.º 1
0
         if ($existingMainNodeID === false or $existingMainNodeID != $mainAssignmentID) {
             if ($existingMainNode and !$existingMainNode->checkAccess('edit')) {
                 return $module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel', array());
             }
             $newMainNode = eZContentObjectTreeNode::fetch($mainAssignmentID);
             if (!$newMainNode) {
                 return $module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
             }
             if (!$newMainNode->checkAccess('edit')) {
                 return $module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
             }
             $mainAssignmentParentID = $newMainNode->attribute('parent_node_id');
             if (eZOperationHandler::operationIsAvailable('content_updatemainassignment')) {
                 $operationResult = eZOperationHandler::execute('content', 'updatemainassignment', array('main_assignment_id' => $mainAssignmentID, 'object_id' => $objectID, 'main_assignment_parent_id' => $mainAssignmentParentID), null, true);
             } else {
                 eZContentOperationCollection::UpdateMainAssignment($mainAssignmentID, $objectID, $newMainNode->attribute('parent_node_id'));
             }
         }
     } else {
         eZDebug::writeError("No MainAssignmentID found for action " . $module->currentAction(), 'content/action');
     }
     return $module->redirectToView('view', array($viewMode, $nodeID, $languageCode));
 } else {
     if ($module->isCurrentAction('AddAssignment') or $module->isCurrentAction('SelectAssignmentLocation')) {
         if (!$module->hasActionParameter('ObjectID')) {
             eZDebug::writeError("Missing ObjectID parameter for action " . $module->currentAction(), 'content/action');
             return $module->redirectToView('view', array('full', 2));
         }
         if (!$module->hasActionParameter('NodeID')) {
             eZDebug::writeError("Missing NodeID parameter for action " . $module->currentAction(), 'content/action');
             return $module->redirectToView('view', array('full', 2));