You are here

function hook_course_handlers in Course 7

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

Allow modules to define handlers that extend Course functionality.

Return value

array A associative array of handler declarations, keyed by type:

  • object: An associative array of course object types, keyed by type:

    • name: A string to reference this type on administrative forms.
    • description: A string to display more information to administrators.
    • class: (optional) A class name which will override the default CourseObject class.
    • fulfillment class: (optional) A class name which will override the default CourseObjectFulfillment class.
  • outline: An asociative array of outline handlers, keyed by type:
    • name: A string to reference this type on administrative forms.
    • description: A string to display more information to administrators.
    • callback: A function name that will return themed course outline HTML.
    • file: (optional) A string to locate the callback file. This should be specified if not located in the implementing module's .module file.
    • file path: (optional) The path to the directory containing the file specified in 'file'. Defaults to the implementing module path.
  • settings: An associative array of configurations, which will be available as secondary tabs from the Course sitewide settings form:

    • name: A string to reference this type on administrative forms.
    • description: A string to display more information to administrators.
    • callback: A function name that will return a Drupal form API array.
    • file: (optional) A string to locate the callback file. This should be specified if not located in the implementing module's .module file.
    • file path: (optional) The path to the directory containing the file specified in 'file'. Defaults to the implementing module path.
    • package: (optional) The key of the settings package this form should be grouped with.
11 functions implement hook_course_handlers()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

course_book_course_handlers in modules/course_book/course_book.module
Implements hook_course_handlers().
course_certificate_course_handlers in modules/course_certificate/course_certificate.module
Implements hook_course_handlers().
course_content_course_handlers in modules/course_content/course_content.module
Implements hook_course_handlers().
course_course_handlers in ./course.module
Implements hook_course_handlers().
course_object_manual_course_handlers in modules/course_object_manual/course_object_manual.module
Implements hook_course_handlers().

... See full list

File

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

Code

function hook_course_handlers() {

  // Example: a custom module definition.
  return array(
    'object' => array(
      'custom' => array(
        'name' => t('Custom'),
        'class' => 'CustomCourseObject',
        'description' => t('A custom course object.'),
      ),
    ),
    'outline' => array(
      'custom' => array(
        'name' => t('Custom'),
        'description' => t('Custom outline display.'),
        'callback' => 'custom_outline',
      ),
    ),
    'settings' => array(
      'custom' => array(
        'name' => t('Custom'),
        'description' => t('Course custom configurations.'),
        'callback' => 'custom_course_settings',
      ),
      'followup' => array(
        'name' => t('Follow up'),
        'description' => t('Course custom followup configurations.'),
        'callback' => 'custom_course_followup_settings',
        'file' => 'includes/another_module.followup.inc',
        'file path' => drupal_get_path('module', 'another_module'),
        'package' => 'custom',
      ),
    ),
  );
}