You are here

function ctools_context_select in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/context.inc \ctools_context_select()

Choose a context or contexts based upon the selection made via ctools_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 ctools_context_selector

4 calls to ctools_context_select()
ctools_access in includes/context.inc
Determine if the current user has access via plugin.
ctools_access_add_restrictions in includes/context.inc
Apply restrictions to contexts based upon the access control configured.
ctools_access_summary in includes/context.inc
Get a summary of an access plugin's settings.
ctools_content_select_context in includes/content.inc
Select the context to be used for a piece of content, based upon config.

File

includes/context.inc, line 523
Contains code related to the ctools system of 'context'.

Code

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