function token_token_list in Token 6
Same name and namespace in other branches
- 5 token.module \token_token_list()
Implements hook_token_list().
File
- ./
token.module, line 137 - The Token API module.
Code
function token_token_list($type = 'all') {
$tokens = array();
if ($type == 'global' || $type == 'all') {
// Current user tokens.
$tokens['global']['user-name'] = t('The name of the currently logged in user.');
$tokens['global']['user-id'] = t('The user ID of the currently logged in user.');
$tokens['global']['user-mail'] = t('The email address of the currently logged in user.');
// Site information tokens.
$tokens['global']['site-url'] = t("The URL of the site's front page.");
$tokens['global']['site-name'] = t('The name of the site.');
$tokens['global']['site-slogan'] = t('The slogan of the site.');
$tokens['global']['site-mission'] = t("The optional 'mission' of the site.");
$tokens['global']['site-mail'] = t('The administrative email address for the site.');
$tokens['global'] += token_get_date_token_info(t('The current'), 'site-date-');
// Current page tokens.
$tokens['global']['current-page-title'] = t('The title of the current page.');
$tokens['global']['current-page-path'] = t('The URL alias of the current page.');
$tokens['global']['current-page-path-raw'] = t('The URL alias of the current page.');
$tokens['global']['current-page-url'] = t('The URL of the current page.');
$tokens['global']['current-page-number'] = t('The page number of the current page when viewing paged lists.');
}
return $tokens;
}