function ctools_relcontext_from_simplecontext_context

Return a new context based on an existing context.

1 string reference to 'ctools_relcontext_from_simplecontext_context'
relcontext_from_simplecontext.inc in ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc
Sample relationship plugin.

File

ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc, line 27

Code

function ctools_relcontext_from_simplecontext_context($context, $conf) {
    // If unset it wants a generic, unfilled context, which is just NULL.
    if (empty($context->data)) {
        return ctools_context_create_empty('relcontext', NULL);
    }
    // You should do error-checking here.
    // Create the new context from some element of the parent context.
    // In this case, we'll pass in the whole context so it can be used to
    // create the relcontext.
    return ctools_context_create('relcontext', $context);
}