function _book_install_type_create
7.x book.install | _book_install_type_create() |
6.x book.install | _book_install_type_create() |
Creates the book content type.
1 call to _book_install_type_create()
- book_install in drupal-7.x/
modules/ book/ book.install - Implements hook_install().
File
- drupal-7.x/
modules/ book/ book.install, line 34 - Install, update and uninstall functions for the book module.
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');
}