function ctools_context_entity_convert_list

Provide a list of ways that this context can be converted to a string.

1 string reference to 'ctools_context_entity_convert_list'
entity.inc in plugins/contexts/entity.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/entity.inc, line 220

Code

function ctools_context_entity_convert_list($plugin) {
    $list = array();
    $entity = entity_get_info($plugin['context name']);
    if (isset($entity['token type'])) {
        $token = $entity['token type'];
    }
    else {
        $token = $plugin['context name'];
    }
    // Hack: we need either token.module or a core fix for this to work right,
    // until then, we just muscle it.
    if ($token == 'taxonomy_term') {
        $token = 'term';
    }
    $tokens = token_info();
    if (isset($tokens['tokens'][$token])) {
        foreach ($tokens['tokens'][$token] as $id => $info) {
            if (!isset($list[$id])) {
                $list[$id] = $info['name'];
            }
        }
    }
    return $list;
}