function _book_flatten_menu

Recursively converts a tree of menu links to a flat array.

Parameters

$tree: A tree of menu links in an array.

$flat: A flat array of the menu links from $tree, passed by reference.

See also

book_get_flat_menu().

1 call to _book_flatten_menu()
book_get_flat_menu in modules/book/book.module
Gets the book menu tree for a page and returns it as a linear array.

File

modules/book/book.module, line 744

Code

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);
            }
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.