You are here

function pathauto_token_list in Pathauto 6

Same name and namespace in other branches
  1. 5.2 pathauto.module \pathauto_token_list()
  2. 6.2 pathauto.module \pathauto_token_list()

Implements hook_token_list().

File

./pathauto.module, line 94
Main file for the Pathauto module, which automatically generates aliases for content.

Code

function pathauto_token_list($type = 'all') {
  $tokens = array();
  if (module_exists('taxonomy')) {
    if ($type == 'taxonomy' || $type == 'all') {
      $tokens['taxonomy']['catpath'] = t('As [cat], but including its supercategories separated by /.');
      $tokens['taxonomy']['catpath-raw'] = t('As [cat-raw], but including its supercategories separated by /.');
      $tokens['taxonomy']['catalias'] = t('The URL alias of the taxonomy term.');
      $tokens['taxonomy']['catalias-raw'] = t('The URL alias of the taxonomy term.');
    }
    if ($type == 'node' || $type == 'all') {
      $tokens['node']['termpath'] = t('As [term], but including its supercategories separated by /.');
      $tokens['node']['termpath-raw'] = t('As [term-raw], but including its supercategories separated by /.');
      $tokens['node']['termalias'] = t('The URL alias of the taxonomy term.');
      $tokens['node']['termalias-raw'] = t('The URL alias of the taxonomy term.');
    }
  }
  if (module_exists('book')) {
    if ($type == 'node' || $type == 'all') {
      $tokens['node']['bookpathalias'] = t('The URL alias of the parent book of the node.');
      $tokens['node']['bookpathalias-raw'] = t('The URL alias of the parent book of the node.');
    }
  }
  return $tokens;
}