function _book_install_type_create

Creates the book content type.

1 call to _book_install_type_create()
book_install in modules/book/book.install
Implements hook_install().

File

modules/book/book.install, line 34

Code

function _book_install_type_create() {
  // Create an additional node type.
  $book_node_type = array(
    'type' => 'book',
    'name' => t('Book page'),
    'base' => 'node_content',
    'description' => t('<em>Books</em> have a built-in hierarchical navigation. Use for handbooks or tutorials.'),
    'custom' => 1,
    'modified' => 1,
    'locked' => 0,
  );
  $book_node_type = node_type_set_defaults($book_node_type);
  node_type_save($book_node_type);
  node_add_body_field($book_node_type);
  // Default to not promoted.
  variable_set('node_options_book', array(
    'status',
  ));
  // Use this default type for adding content to books.
  variable_set('book_allowed_types', array(
    'book',
  ));
  variable_set('book_child_type', 'book');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.