function book_children

Same name and namespace in other branches
  1. 7.x drupal-7.x/modules/book/book.module \book_children()

Format the menu links for the child pages of the current page.

1 call to book_children()
template_preprocess_book_navigation in drupal-6.x/modules/book/book.module
Process variables for book-navigation.tpl.php.

Archivo

drupal-6.x/modules/book/book.module, line 589
Allows users to structure the pages of a site in a hierarchy or outline.

Código

function book_children($book_link) {
  $flat = book_get_flat_menu($book_link);

  $children = array();

  if ($book_link['has_children']) {
    // Walk through the array until we find the current page.
    do {
      $link = array_shift($flat);
    } while ($link && ($link['mlid'] != $book_link['mlid']));
    // Continue though the array and collect the links whose parent is this page.
    while (($link = array_shift($flat)) && $link['plid'] == $book_link['mlid']) {
      $data['link'] = $link;
      $data['below'] = '';
      $children[] = $data;
    }
  }
  return $children ? menu_tree_output($children) : '';
}