function book_page_alter

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);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!book!book.module/function/book_page_alter/7.x