function ack_menu_tree_data in Access Control Kit 7
Sorts and returns a realm's links as a menu tree.
Parameters
array $links: A flat array of menu links, as returned by ack_menu_realm_links().
Return value
array An array of menu links in the form of a tree. Each item in the tree is an associative array containing:
- link: The menu link item from $links.
- below: An array containing the subtree of this item, where each element is a tree item array with 'link' and 'below' elements. This array will be empty if the menu item has no accessible items in its subtree.
1 call to ack_menu_tree_data()
- ack_menu_overview_form in ack_menu/
ack_menu.pages.inc - Form for editing the menu tree for a realm.
File
- ack_menu/
ack_menu.pages.inc, line 223 - Page callbacks for managing menu links in assigned realms.
Code
function ack_menu_tree_data(array $links) {
// Reverse the array so we can use the more efficient array_pop() function.
$links = array_reverse($links);
return _ack_menu_tree_data($links);
}