You are here

function ctools_context_create_empty in Chaos Tool Suite (ctools) 7

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

Create an empty context object.

Empty context objects are primarily used as placeholders in the UI where the actual contents of a context object may not be known. It may have additional text embedded to give the user clues as to how the context is used.

Parameters

$type: The type of context to create; this loads a plugin.

Return value

ctools_context A $context or NULL if one could not be created.

29 calls to ctools_context_create_empty()
ctools_argument_entity_id_context in plugins/arguments/entity_id.inc
Discover if this argument gives us the entity we crave.
ctools_argument_nid_context in plugins/arguments/nid.inc
Discover if this argument gives us the node we crave.
ctools_argument_rid_context in plugins/arguments/rid.inc
Discover if this argument gives us the node we crave.
ctools_argument_uid_context in plugins/arguments/uid.inc
Discover if this argument gives us the user we crave.
ctools_argument_user_name_context in plugins/arguments/user_name.inc
Discover if this argument gives us the user we crave.

... See full list

File

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

Code

function ctools_context_create_empty($type) {
  $plugin = ctools_get_context($type);
  if ($function = ctools_plugin_get_function($plugin, 'context')) {
    $context = $function(TRUE, NULL, FALSE, $plugin);
    if (is_object($context)) {
      $context->empty = TRUE;
    }
    return $context;
  }
}