You are here

function ctools_get_context in Chaos Tool Suite (ctools) 7

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

Fetch metadata on a specific context plugin.

Parameters

string $context: Name of a context.

Return value

array An array with information about the requested panel context.

14 calls to ctools_get_context()
ctools_context_convert_context in includes/context.inc
Let the context convert an argument based upon the converter that was given.
ctools_context_create in includes/context.inc
Create a new context object.
ctools_context_create_empty in includes/context.inc
Create an empty context object.
ctools_context_get_context_from_context in includes/context.inc
Return a context object from a context definition array.
ctools_context_keyword_substitute in includes/context.inc
Perform keyword and context substitutions.

... See full list

1 string reference to 'ctools_get_context'
ctools_context_info in includes/context-admin.inc
Provide a list of the ways contexts can be embedded.

File

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

Code

function ctools_get_context($context) {
  static $gate = array();
  ctools_include('plugins');
  $plugin = ctools_get_plugins('ctools', 'contexts', $context);
  if (empty($gate['context']) && !empty($plugin['superceded by'])) {

    // This gate prevents infinite loops.
    $gate[$context] = TRUE;
    $new_plugin = ctools_get_plugins('ctools', 'contexts', $plugin['superceded by']);
    $gate[$context] = FALSE;

    // If a new plugin was returned, return it. Otherwise fall through and
    // return the original we fetched.
    if ($new_plugin) {
      return $new_plugin;
    }
  }
  return $plugin;
}