function hook_course_has_take in Course 8.3
Same name and namespace in other branches
- 8.2 course.api.php \hook_course_has_take()
- 3.x course.api.php \hook_course_has_take()
Allow modules to restrict menu access to the take course tab.
Parameters
object $node: The course node.
object $user: The user to check access.
Return value
boolean Any hook returning FALSE will restrict access to the take course tab.
1 invocation of hook_course_has_take()
- course_take_course_menu_access in ./
course.module - Menu access callback to determins if the take course button should display on the course node.
File
- ./
course.api.php, line 81 - Hooks provided by Course module.
Code
function hook_course_has_take($node, $user) {
if ($node->type == 'imported_course') {
// Users cannot take imported courses.
return FALSE;
}
}