_menu_parents_recurse
function _menu_parents_recurse
_menu_parents_recurse($tree, $menu_name, $indent, &$options, $exclude, $depth_limit)
Recursive helper function for menu_parent_options().
File
- modules/menu/menu.module, line 426
- Allows administrators to customize the site's navigation menus.
Code
function _menu_parents_recurse($tree, $menu_name, $indent, &$options, $exclude, $depth_limit) { foreach ($tree as $data) { if ($data['link']['depth'] > $depth_limit) { // Don't iterate through any links on this level. break; } if ($data['link']['mlid'] != $exclude && $data['link']['hidden'] >= 0) { $title = $indent . ' ' . truncate_utf8($data['link']['title'], 30, TRUE, FALSE); if ($data['link']['hidden']) { $title .= ' (' . t('disabled') . ')'; } $options[$menu_name . ':' . $data['link']['mlid']] = $title; if ($data['below']) { _menu_parents_recurse($data['below'], $menu_name, $indent . '--', $options, $exclude, $depth_limit); } } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!menu!menu.module/function/_menu_parents_recurse/7.x