You are here

function panels_context_select in Panels 6.2

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

Choose a context based upon the selection made via panels_context_filter

Parameters

$contexts: A keyed array of all available contexts

$required: The required context object provided by the plugin

$context: The selection made using panels_context_selector

1 call to panels_context_select()
panels_pane_select_context in includes/plugins.inc
Select a context for a pane.

File

includes/plugins.inc, line 1063
plugins.inc

Code

function panels_context_select($contexts, $required, $context) {
  if (is_array($required)) {
    $result = array();
    foreach ($required as $id => $r) {
      if (($result[] = _panels_context_select($contexts, $r, $context[$id])) == FALSE) {
        return FALSE;
      }
    }
    return $result;
  }
  return _panels_context_select($contexts, $required, $context);
}