function rules_token_info

Implements hook_token_info().

File

./rules.module, line 1718

Code

function rules_token_info() {
    $cache = rules_get_cache();
    $data_info = $cache['data_info'];
    $types = array(
        'text',
        'integer',
        'uri',
        'token',
        'decimal',
        'date',
        'duration',
    );
    foreach ($types as $type) {
        $token_type = $data_info[$type]['token type'];
        $token_info['types'][$token_type] = array(
            'name' => $data_info[$type]['label'],
            'description' => t('Tokens related to %label Rules variables.', array(
                '%label' => $data_info[$type]['label'],
            )),
            'needs-data' => $token_type,
        );
        $token_info['tokens'][$token_type]['value'] = array(
            'name' => t("Value"),
            'description' => t('The value of the variable.'),
        );
    }
    return $token_info;
}