book_toc
- Drupal 5
- Drupal 6
modules/book/book.module, строка 862
- Версии
- 5
book_toc($exclude = 0)
- 6
book_toc($bid, $exclude = array(), $depth_limit)
Returns an array of book pages in table of contents order.
Параметры
$bid
The ID of the book whose pages are to be listed.
$exclude
Optional array of mlid values. Any link whose mlid is in this array
will be excluded (along with its children).
$depth_limit
Any link deeper than this value will be excluded (along with its children).
Возвращаемое значение
An array of mlid, title pairs for use as options for selecting a book page.
Код
<?php
function book_toc($bid, $exclude = array(), $depth_limit) {
$tree = menu_tree_all_data(book_menu_name($bid));
$toc = array();
_book_toc_recurse($tree, '', $toc, $exclude, $depth_limit);
return $toc;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии