book_toc_recurse

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/book/book.module, строка 517

Версии
5
book_toc_recurse($nid, $indent, $toc, $children, $exclude)

This is a helper function for book_toc().

▾ 2 функции вызывают book_toc_recurse()

book_toc in modules/book/book.module
Returns an array of titles and nid entries of book pages in table of contents order.
book_toc_recurse in modules/book/book.module
This is a helper function for book_toc().

Код

<?php
function book_toc_recurse($nid, $indent, $toc, $children, $exclude) {
  if ($children[$nid]) {
    foreach ($children[$nid] as $foo => $node) {
      if (!$exclude || $exclude != $node->nid) {
        $toc[$node->nid] = $indent .' '. $node->title;
        $toc = book_toc_recurse($node->nid, $indent .'--', $toc, $children, $exclude);
      }
    }
  }

  return $toc;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему