You are here

function hook_course_handlers_alter in Course 7

Same name and namespace in other branches
  1. 6 course.api.php \hook_course_handlers_alter()
  2. 7.2 course.api.php \hook_course_handlers_alter()

Allow modules to alter each other's list of handlers.

Parameters

array $handlers: By reference. The return value from each module that implements hook_course_handlers().

type $module:

See also

course_get_handlers()

File

./course.api.php, line 104
Hooks provided by Course module.

Code

function hook_course_handlers_alter(&$handlers, $module) {

  // Example: alter the class of a course object handler.
  $is_quiz_type = isset($handlers['object']) && isset($handlers['object']['quiz']);
  if ($module == 'course_quiz' && $is_quiz_type) {

    // Change which class should be used.
    $handlers['object']['quiz']['class'] = 'CustomQuizCourseObject';
  }
}