Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Renders a submenu tree.
- *
- * @param string $menu
- * The internal menu name
- * @param string $path
- * The path. May be an alias.
- * @return array
- * Menu tree render array
- */
- function EXAMPLE_build_menu_tree($menu, $path) {
- $link = menu_link_get_preferred(drupal_get_normal_path($path));
- if(empty($link['depth'])) {
- return array();
- }
- $parameters = array(
- 'min_depth' => $link['depth'] + 1,
- 'conditions' => array('p' . $link['depth'] => $link['mlid']),
- );
- $tree = menu_build_tree($menu, $parameters);
- return menu_tree_output($tree);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement