function ctools_context_token_convert_list

Implementation of hook_ctools_context_convert_list().

Return value

array|null An array of token type information, keyed by 'type:id', or NULL if none found.

1 string reference to 'ctools_context_token_convert_list'
token.inc in plugins/contexts/token.inc

File

plugins/contexts/token.inc, line 45

Code

function ctools_context_token_convert_list() {
    $tokens = token_info();
    // Initialise $list here?
    foreach ($tokens['types'] as $type => $type_info) {
        if (empty($type_info['needs-data'])) {
            $real_type = isset($type_info['type']) ? $type_info['type'] : $type;
            foreach ($tokens['tokens'][$real_type] as $id => $info) {
                $key = "{$type}:{$id}";
                if (!isset($list[$key])) {
                    $list[$key] = $type_info['name'] . ': ' . $info['name'];
                }
            }
        }
    }
    return $list;
}