_book_flatten_menu

Versions
6 – 7
_book_flatten_menu($tree, &$flat)

Recursive helper function for book_get_flat_menu().

▾ 2 functions call _book_flatten_menu()

book_get_flat_menu in modules/book/book.module
Get the book menu tree for a page, and return it as a linear array.
_book_flatten_menu in modules/book/book.module
Recursive helper function for book_get_flat_menu().

Code

modules/book/book.module, line 528

<?php
function _book_flatten_menu($tree, &$flat) {
  foreach ($tree as $data) {
    if (!$data['link']['hidden']) {
      $flat[$data['link']['mlid']] = $data['link'];
      if ($data['below']) {
        _book_flatten_menu($data['below'], $flat);
      }
    }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.