You are here

function taxonomy_token_list in Token 6

Same name and namespace in other branches
  1. 5 token_taxonomy.inc \taxonomy_token_list()

Implements hook_token_list().

File

./token_taxonomy.inc, line 19
Implementations of token module hooks for the core taxonomy module.

Code

function taxonomy_token_list($type = 'all') {
  $tokens = array();

  // Taxonomy term tokens.
  if ($type == 'taxonomy' || $type == 'all') {
    $tokens['taxonomy']['tid'] = t('The unique ID of the taxonomy term.');
    $tokens['taxonomy']['cat'] = t('The name of the taxonomy term.');
    $tokens['taxonomy']['cat-raw'] = t('The name of the taxonomy term.');
    $tokens['taxonomy']['cat-description'] = t('The optional description of the taxonomy term.');
    $tokens['taxonomy']['vid'] = t("The unique ID of the taxonomy vocabulary the taxonomy term belongs to.");
    $tokens['taxonomy']['vocab'] = t("The name of the taxonomy vocabulary the taxonomy term belongs to.");
    $tokens['taxonomy']['vocab-raw'] = t("The name of the taxonomy vocabulary the taxonomy term belongs to.");
    $tokens['taxonomy']['vocab-description'] = t('The optional description of the taxonomy vocabulary the taxonomy term belongs to.');
    $tokens['taxonomy']['vocab-description-raw'] = t('The optional description of the taxonomy vocabulary the taxonomy term belongs to.');
  }

  // Vocabulary tokens.
  if ($type == 'vocabulary' || $type == 'all') {
    $tokens['vocabulary']['vocabulary-vid'] = t('The unique ID of the taxonomy vocabulary.');
    $tokens['vocabulary']['vocabulary-name'] = t('The name of the taxonomy vocabulary.');
    $tokens['vocabulary']['vocabulary-name-raw'] = t('The name of the taxonomy vocabulary.');
    $tokens['vocabulary']['vocabulary-description'] = t('The optional description of the taxonomy vocabulary.');
    $tokens['vocabulary']['vocabulary-description-raw'] = t('The optional description of the taxonomy vocabulary.');
  }
  return $tokens;
}