You are here

function course_render_button in Course 6

Check the permissions of showing the take course button, and return the HTML.

2 calls to course_render_button()
course_course_take_course_button_content_type_render in plugins/content_types/course_take_course_button.inc
Render callback.
course_nodeapi in ./course.module
Implements hook_nodeapi().

File

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

Code

function course_render_button($node) {
  global $user;
  $can_enrol = course_enrol_access($node, $user);
  if ($can_enrol['success']) {

    // User can self-enrol and take the course. Show the button.
    return course_take_course_button_html($node);
  }
}