function hook_course_has_takecourse in Course 7.2
Same name and namespace in other branches
- 6 course.api.php \hook_course_has_takecourse()
- 7 course.api.php \hook_course_has_takecourse()
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_takecourse()
- 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 164 - Hooks provided by Course module.
Code
function hook_course_has_takecourse($node, $user) {
if ($node->type == 'imported_course') {
// Users cannot take imported courses.
return FALSE;
}
}