Пример #1
0
        }
        eZNodeAssignment::purgeByID($assignmentID);
    }
    if ($mainNodeChanged) {
        eZNodeAssignment::setNewMainAssignment($objectID, $editVersion);
    }
    $db->commit();
    return $module->redirectToView('edit', array($objectID, $editVersion, $editLanguage, $fromLanguage));
} else {
    if ($module->isCurrentAction('CancelRemoval')) {
        $http->removeSessionVariable('AssignmentRemoveData');
        return $module->redirectToView('edit', array($objectID, $editVersion, $editLanguage, $fromLanguage));
    }
}
// default action: show the confirmation dialog
$assignmentsToRemove = eZNodeAssignment::fetchListByID($removeList);
$removeList = array();
$canRemoveAll = true;
foreach ($assignmentsToRemove as $assignment) {
    $node = $assignment->attribute('node');
    // skip assignments which don't have associated node or node with no children
    if (!$node) {
        continue;
    }
    $count = $node->subTreeCount(array('Limitation' => array()));
    if ($count < 1) {
        continue;
    }
    // Find the number of items in the subtree we are allowed to remove
    // if this differs from the total count it means we have items we cannot remove
    // We do this by fetching the limitation list for content/remove