Advertisement
Guest User

Untitled

a guest
May 24th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2. /**
  3. * Renders a submenu tree.
  4. *
  5. * @param string $menu
  6. * The internal menu name
  7. * @param string $path
  8. * The path. May be an alias.
  9. * @return array
  10. * Menu tree render array
  11. */
  12. function EXAMPLE_build_menu_tree($menu, $path) {
  13. $link = menu_link_get_preferred(drupal_get_normal_path($path));
  14. if(empty($link['depth'])) {
  15. return array();
  16. }
  17. $parameters = array(
  18. 'min_depth' => $link['depth'] + 1,
  19. 'conditions' => array('p' . $link['depth'] => $link['mlid']),
  20. );
  21. $tree = menu_build_tree($menu, $parameters);
  22. return menu_tree_output($tree);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement