_book_toc_recurse
- Versions
- 6 – 7
_book_toc_recurse($tree, $indent, &$toc, $exclude, $depth_limit)
A recursive helper function for book_toc().
Code
modules/book/book.module, line 1003
<?php
function _book_toc_recurse($tree, $indent, &$toc, $exclude, $depth_limit) {
foreach ($tree as $data) {
if ($data['link']['depth'] > $depth_limit) {
// Don't iterate through any links on this level.
break;
}
if (!in_array($data['link']['mlid'], $exclude)) {
$toc[$data['link']['mlid']] = $indent . ' ' . truncate_utf8($data['link']['title'], 30, TRUE, TRUE);
if ($data['below']) {
_book_toc_recurse($data['below'], $indent . '--', $toc, $exclude, $depth_limit);
}
}
}
}
?>Login or register to post comments 