7.x book.module book_page_alter(&$page)

Implements hook_page_alter().

Adds the book menu to the list of menus used to build the active trail when viewing a book page.

File

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

Code

function book_page_alter(&$page) {
  if (($node = menu_get_object()) && !empty($node->book['bid'])) {
    $active_menus = menu_get_active_menu_names();
    $active_menus[] = $node->book['menu_name'];
    menu_set_active_menu_names($active_menus);
  }
}