function _menu_link_map_translate

_menu_link_map_translate(&$map, $to_arg_functions)

Translates the path elements in the map using any to_arg helper function.

Parameters

$map: An array of path arguments; for example, array('node', '5').

$to_arg_functions: An array of helper functions; for example, array(2 => 'menu_tail_to_arg').

See also

hook_menu()

Related topics

File

includes/menu.inc, line 820
API for the Drupal menu system.

Code

function _menu_link_map_translate(&$map, $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] : '', $map, $index);
    if (!empty($map[$index]) || isset($arg)) {
      $map[$index] = $arg;
    }
    else {
      unset($map[$index]);
    }
  }
}

© 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/includes!menu.inc/function/_menu_link_map_translate/7.x