_book_toc_recurse
modules/book/book.module, строка 834
- Версии
- 6
_book_toc_recurse($tree, $indent, &$toc, $exclude, $depth_limit)
Рекурсивная вспомогательная функция для book_toc()
.
Код
<?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);
}
}
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии