diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-08-25 10:29:18 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-08-25 10:29:18 +0000 |
commit | ffb803bae23619ffd365f026cd29a24de204df66 (patch) | |
tree | b85ec2a2776b5bde5a7744e414ba1b29199a9d67 /includes | |
parent | 801756e7e69cfc8a22d8c1c612a31391872c35bc (diff) | |
download | brdo-ffb803bae23619ffd365f026cd29a24de204df66.tar.gz brdo-ffb803bae23619ffd365f026cd29a24de204df66.tar.bz2 |
#157510 by pwolanin and chx: search module needs menu tail arguments (arbitrary 'directory' looking parts)
Diffstat (limited to 'includes')
-rw-r--r-- | includes/menu.inc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index eafad5831..0c7a2a928 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -336,7 +336,6 @@ function _menu_load_objects($item, &$map) { $path_map = $map; foreach ($load_functions as $index => $function) { if ($function) { - $return = $function(isset($path_map[$index]) ? $path_map[$index] : ''); // If callback returned an error or there is no callback, trigger 404. if ($return === FALSE) { @@ -478,14 +477,14 @@ function _menu_translate(&$router_item, $map, $to_arg = FALSE) { * @param map * An array of path arguments (ex: array('node', '5')) * @param $to_arg_functions - * An array of helper function (ex: array(1 => 'node_load')) + * An array of helper function (ex: array(2 => 'menu_tail_to_arg')) */ function _menu_link_map_translate(&$map, $to_arg_functions) { if ($to_arg_functions) { $to_arg_functions = unserialize($to_arg_functions); foreach ($to_arg_functions as $index => $function) { // Translate place-holders into real values. - $arg = $function(!empty($map[$index]) ? $map[$index] : ''); + $arg = $function(!empty($map[$index]) ? $map[$index] : '', $map, $index); if (!empty($map[$index]) || isset($arg)) { $map[$index] = $arg; } @@ -496,6 +495,10 @@ function _menu_link_map_translate(&$map, $to_arg_functions) { } } +function menu_tail_to_arg($arg, $map, $index) { + return implode('/', array_slice($map, $index)); +} + /** * This function is similar to _menu_translate() but does link-specific * preparation such as always calling to_arg functions |