function om_menu_tree_options in OM Maximenu 6
Same name and namespace in other branches
- 8 inc/om_maximenu.utils.inc \om_menu_tree_options()
- 7 inc/om_maximenu.utils.inc \om_menu_tree_options()
Get the hierarchy of menus
1 call to om_menu_tree_options()
- om_maximenu_import in inc/
om_maximenu.import.inc - Import from existing menus
File
- inc/
om_maximenu.utils.inc, line 530 - OM Maximenu Admin Utilities
Code
function om_menu_tree_options(&$options, $menus, $menu_name = 'navigation') {
global $_om_maximenu_existing_menus;
$existing = $_om_maximenu_existing_menus[$menu_name];
static $level = 1;
// count level for indents on divs on html file
$tab = '-';
// init tab for indents on divs on html file
// for source formating
// calculates number of tabs
for ($i = 1; $i < $level; $i++) {
$tab .= '-';
}
foreach ($menus as $mlid => $link_title) {
if (isset($existing[$mlid])) {
$level++;
$options[$mlid] = $tab . $link_title;
om_menu_tree_options($options, $existing[$mlid], $menu_name);
$level--;
}
else {
$options[$mlid] = $tab . $link_title;
}
}
}