You are here

function panels_argument_get_display in Panels 5.2

Same name and namespace in other branches
  1. 6.2 includes/plugins.inc \panels_argument_get_display()

Choose a display based upon arguments and loaded contexts.

Parameters

$arguments: The array of argument definitions

$contexts: The array of existing contexts.

Return value

The identification of the display to use

1 call to panels_argument_get_display()
panels_page_view_page in panels_page/panels_page.module
Page callback to view a panel page.

File

includes/plugins.inc, line 846
plugins.inc

Code

function panels_argument_get_display($arguments, $contexts) {
  $display_candidate = NULL;
  foreach ($arguments as $i => $argument) {
    $id = panels_argument_context_id($argument);
    if (!empty($contexts[$id]) && !empty($contexts[$id]->data)) {
      $context = $contexts[$id];
      $d = panels_argument_choose_display($argument['name'], $argument['argument_settings'], $context);
      if ($d) {
        $display_candidate = "argument_{$i}" . '-' . $d;
      }
    }
  }
  return $display_candidate;
}