function book_toc

book_toc($bid, $depth_limit, $exclude = array())

Returns an array of book pages in table of contents order.

Parameters

$bid: The ID of the book whose pages are to be listed.

$depth_limit: Any link deeper than this value will be excluded (along with its children).

$exclude: Optional array of menu link ID values. Any link whose menu link ID is in this array will be excluded (along with its children).

Return value

An array of (menu link ID, title) pairs for use as options for selecting a book page.

File

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

Code

function book_toc($bid, $depth_limit, $exclude = array()) {
  $tree = menu_tree_all_data(book_menu_name($bid));
  $toc = array();
  _book_toc_recurse($tree, '', $toc, $exclude, $depth_limit);

  return $toc;
}

© 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_toc/7.x