You are here

function course_node_export_node_alter in Course 6

Same name and namespace in other branches
  1. 8.3 includes/course.exporting.inc \course_node_export_node_alter()
  2. 8.2 includes/course.exporting.inc \course_node_export_node_alter()
  3. 7.2 includes/course.exporting.inc \course_node_export_node_alter()
  4. 7 includes/course.exporting.inc \course_node_export_node_alter()
  5. 3.x includes/course.exporting.inc \course_node_export_node_alter()

Implements hook_node_export_node_alter().

Allow course objects to freeze data into the export.

File

includes/course.exporting.inc, line 38

Code

function course_node_export_node_alter($node, $original_node, $op) {
  if ($op == 'export') {
    if (course_node_is_course($node)) {
      $course = course_get_course($node);
      if (arg(2) == 'node_export') {
        course_clone_warning_messages($course);
        foreach ($course
          ->getObjects() as $object) {
          if ($object
            ->getCloneAbility() !== FALSE) {
            $node->course['objects'][$object
              ->getId()]->freeze = $object
              ->freeze();
          }
        }
      }
    }
  }
}