function course_field_access in Course 7
Same name and namespace in other branches
- 7.2 course.module \course_field_access()
Implements hook_field_access().
Don't show the user fields that weren't marked as enrollment fields.
File
- ./
course.module, line 2943 - course.module Core functionality for Courses.
Code
function course_field_access($op, $field, $entity_type, $entity, $account) {
if ($entity && $entity_type == 'course_enrollment' && $op == 'edit') {
$instance = field_info_instance($entity_type, $field['field_name'], $entity->type);
if (empty($instance['settings']['course_enrollment_user_field'])) {
return FALSE;
}
}
}