1.20.x layout.module layout_path_load($arg_value, $menu_item_name, $path_parts, $arg_position)

Menu loader callback; Convert %layout_path placeholders to loaded objects.

File

modules/layout/layout.module, line 490
The Layout module creates pages and wraps existing pages in layouts.

Code

function layout_path_load($arg_value, $menu_item_name, $path_parts, $arg_position) {
  $menu_item = layout_menu_item_load($menu_item_name);
  $contexts = $menu_item->getContexts();
  $context_info = layout_get_context_info($contexts[$arg_position]->plugin);
  if (isset($context_info['load callback']) && function_exists($context_info['load callback'])) {
    return call_user_func_array($context_info['load callback'], array($arg_value));
  }

  // Pass-through the string argument if no load callback specified.
  return $arg_value;
}