1 book.module book_node_insert(Node $node)

Implements hook_node_insert().

File

core/modules/book/book.module, line 930
Allows users to create and organize related content in an outline.

Code

function book_node_insert(Node $node) {
  if (!empty($node->book['bid'])) {
    if ($node->book['bid'] == 'new') {
      // New nodes that are their own book.
      $node->book['bid'] = $node->nid;
    }
    $node->book['nid'] = $node->nid;
    $node->book['menu_name'] = book_menu_name($node->book['bid']);
    _book_update_outline($node);
    $destination = backdrop_get_destination();
    if ($destination['destination'] != 'admin/content/book/' . $node->book['bid'] && _book_outline_access($node)) {
      backdrop_set_message(t('Reorder book pages from the <a href="@url">book outline</a>.', array('@url' => url('admin/content/book/' . $node->book['bid']))));
    }
  }
}