diff options
Diffstat (limited to 'includes/menu.inc')
-rw-r--r-- | includes/menu.inc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index acd0027a0..f3b6dff05 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -531,18 +531,18 @@ function menu_rebuild() { if (preg_match('/^%([a-z_]*)$/', $part, $matches)) { if (empty($matches[1])) { $match = TRUE; + $load_functions[$k] = NULL; + $to_arg_functions[$k] = NULL; } else { - if (function_exists($matches[1] .'_load')) { - $load_functions[$k] = $matches[1] .'_load'; - $match = TRUE; - } if (function_exists($matches[1] .'_to_arg')) { $to_arg_functions[$k] = $matches[1].'_to_arg'; + $load_functions[$k] = NULL; $match = TRUE; } - if (!isset($load_functions[$k]) && isset($to_arg_functions[$k])) { - $load_functions[$k] = FALSE; + if (function_exists($matches[1] .'_load')) { + $load_functions[$k] = $matches[1] .'_load'; + $match = TRUE; } } } @@ -670,6 +670,9 @@ function menu_rebuild() { if (!isset($item['parent'])) { $item['parent'] = implode('/', array_slice($item['_parts'], 0, $item['_number_parts'] - 1)); } + else { + $item['_depth'] = $item['parent'] ? $menu[$item['parent']]['_depth'] + 1 : 1; + } } else { // Non-tab items specified the parent for visible links, and it's |