You are here

function course_object_load in Course 6

Same name and namespace in other branches
  1. 7.2 course.module \course_object_load()
  2. 7 course.module \course_object_load()

Menu loader for course objects, in the context of a course.

2 calls to course_object_load()
course_object_options_form_submit in ./course.module
Form submission handler for course_object_options_form().
course_object_options_form_validate in ./course.module
Form validation handler for course_object_options_form().

File

./course.module, line 535
course.module Core functionality for Courses.

Code

function course_object_load($coid) {
  global $user;
  $nid = arg(0) == 'node' && is_numeric(arg(1)) ? arg(1) : 0;

  // Stored course object.
  $courseObject = course_get_course_object_by_id($coid, $user);
  if ($courseObject && $nid) {

    // If we're loading this from a menu loader, set the course.
    $courseObject
      ->setCourse($nid);
  }
  return $courseObject;
}