function ctools_context_create

Create a new context object.

Parameters

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

mixed $data: The data to put into the context.

$conf: A configuration structure if this context was created via UI.

Return value

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

32 calls to ctools_context_create()
CtoolsContextKeywordsSubstitutionTestCase::testKeywordsSubstitution in tests/context.test
Test the keyword substitution.
ctools_access_get_loggedin_context in includes/context.inc
Create a context for the logged in user.
ctools_ajax_simple_form in ctools_ajax_sample/ctools_ajax_sample.module
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.

... See full list

File

includes/context.inc, line 974

Code

function ctools_context_create($type, $data = NULL, $conf = FALSE) {
    ctools_include('plugins');
    $plugin = ctools_get_context($type);
    if ($function = ctools_plugin_get_function($plugin, 'context')) {
        return $function(FALSE, $data, $conf, $plugin);
    }
}