function book_page_alter in Drupal 7
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 908 - 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);
}
}