function course_handle_clone in Course 7.2
Same name and namespace in other branches
- 8.3 includes/course.exporting.inc \course_handle_clone()
- 8.2 includes/course.exporting.inc \course_handle_clone()
- 6 includes/course.exporting.inc \course_handle_clone()
- 7 includes/course.exporting.inc \course_handle_clone()
- 3.x includes/course.exporting.inc \course_handle_clone()
Freeze course objects onto a node if necessary.
1 call to course_handle_clone()
- course_node_update in ./
course.module - Implements hook_node_update().
File
- includes/
course.exporting.inc, line 64
Code
function course_handle_clone($node) {
if (isset($node->clone_from_original_nid) && ($original = node_load($node->clone_from_original_nid))) {
$node->course['objects'] = course_get_course($original)
->getObjects();
switch ($node->course['clone_type']) {
case 'reference':
break;
case 'new':
foreach ($node->course['objects'] as $object_data) {
unset($object_data->instance);
}
break;
case 'clone':
default:
foreach ($node->course['objects'] as $object_data) {
$courseObject = course_get_course_object_by_id($object_data->coid);
if ($courseObject
->getCloneAbility() === FALSE) {
unset($object_data->instance);
}
$object_data->freeze = $courseObject
->freeze();
}
break;
}
}
}