You are here

function panels_context_filter in Panels 6.2

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

Return a keyed array of context that match the given 'required context' filters.

Parameters

$contexts: A keyed array of all available contexts.

$required: The required context string or array.

Return value

A keyed array of contexts.

3 calls to panels_context_filter()
panels_get_available_content_types in includes/plugins.inc
Get an array of all available content types that can be fed into the display editor for the add content list.
panels_get_relevant_relationships in includes/plugins.inc
Fetch all relevant relationships
_panels_context_selector in includes/plugins.inc

File

includes/plugins.inc, line 968
plugins.inc

Code

function panels_context_filter($contexts, $required) {
  if (is_array($required)) {
    $result = array();
    foreach ($required as $r) {
      $result = array_merge($result, _panels_context_filter($contexts, $r));
    }
    return $result;
  }
  return _panels_context_filter($contexts, $required);
}