function ctools_context_node_convert

Convert a context into a string.

1 call to ctools_context_node_convert()
ctools_context_node_edit_convert in plugins/contexts/node_edit_form.inc
Convert a context into a string.
1 string reference to 'ctools_context_node_convert'
node.inc in plugins/contexts/node.inc
Plugin to provide a node context. A node context is a node wrapped in a context object that can be utilized by anything that accepts contexts.

File

plugins/contexts/node.inc, line 172

Code

function ctools_context_node_convert($context, $type) {
    $tokens = token_info();
    if (isset($tokens['tokens']['node'][$type])) {
        $values = token_generate('node', array(
            $type => $type,
        ), array(
            'node' => $context->data,
        ));
        if (isset($values[$type])) {
            return $values[$type];
        }
    }
}