1.20.x menu.module | _menu_get_options($menus, $available_menus, $item) |
Helper function to get the items of the given menu.
File
- modules/
menu/ menu.module, line 426 - Allows administrators to customize the site's menus.
Code
function _menu_get_options($menus, $available_menus, $item) {
// If the item has children, there is an added limit to the depth of valid parents.
if (isset($item['parent_depth_limit'])) {
$limit = $item['parent_depth_limit'];
}
else {
$limit = _menu_parent_depth_limit($item);
}
$options = array();
$langcode = NULL;
if (module_exists('language') && isset($item['langcode'])) {
$langcode = $item['langcode'];
}
foreach ($menus as $menu_name => $title) {
if (isset($available_menus[$menu_name])) {
$tree = menu_tree_all_data($menu_name, NULL, NULL, $langcode);
$options[$menu_name . ':0'] = $title;
_menu_parents_recurse($tree, $menu_name, '· ', $options, $item['mlid'], $limit);
}
}
return $options;
}