You are here

function panels_page_construct_menu_item_metadata in Panels 6.2

2 calls to panels_page_construct_menu_item_metadata()
panels_page_construct_dynamic_menu_link in panels_page/panels_page.menu.inc
panels_page_construct_static_menu_link in panels_page/panels_page.menu.inc
Build a panels_page menu entry for a static panels_page.

File

panels_page/panels_page.menu.inc, line 369
panels_page.menu.inc

Code

function panels_page_construct_menu_item_metadata(&$items, $panel_page, $load_flags = 0) {
  $metadata = new stdClass();
  $metadata->pid = $panel_page->pid;
  $metadata->name = $panel_page->name;
  $metadata->type = _panels_page_menu_type($panel_page);
  $metadata->path = $panel_page->path;
  $metadata->load_flags = $load_flags;
  if (!empty($panel_page->arguments)) {
    $metadata->load_functions = array();

    // @TODO This code assumes that the first argument in the stack is the one
    // we want to inherit from. This may or may not be a valid assumption.
    while (list($i, $arg_data) = each($panel_page->arguments)) {
      if ($i == 0) {
        $argument = panels_get_argument($arg_data['name']);
        if (!empty($argument['native path'])) {
          $metadata->native_path = $argument['native path'];
        }
        if ($function = panels_plugin_get_function('arguments', $argument['name'], 'menu builder')) {
          $metadata->menu_builder = $function;
          $metadata->arg_data = $arg_data;
        }
      }
      $metadata->load_functions[] = !empty($argument['load function']) ? $argument['load function'] : '';
    }
  }
  $items['metadata'][$panel_page->path] = $metadata;
}