You are here

function course_install in Course 6

Same name and namespace in other branches
  1. 8.3 course.install \course_install()
  2. 8.2 course.install \course_install()
  3. 7.2 course.install \course_install()
  4. 7 course.install \course_install()
  5. 3.x course.install \course_install()

Implements hook_install().

Install a default content type, set some defaults.

File

./course.install, line 13
course.install Install and update functions for Courses.

Code

function course_install() {
  drupal_install_schema('course');
  module_load_include('module', 'node', 'node');
  $type = array(
    'type' => 'course',
    'name' => 'Course',
    'module' => 'node',
    'has_title' => 1,
    'title_label' => 'Title',
    'has_body' => 1,
    'body_label' => 'Description',
    'description' => 'A <em>course</em> containing Drupal learning objects.',
    'custom' => TRUE,
    'modified' => TRUE,
    'locked' => FALSE,
    'help' => '',
    'min_word_count' => '',
  );
  $type = (object) _node_type_set_defaults($type);
  node_type_save($type);
  node_types_rebuild();
  menu_rebuild();
  variable_set('course_use_course', 1);
}