function _name_token_list in Name Field 6
Implementation of hook_token_list().
1 call to _name_token_list()
- name_token_list in ./
name.module - Implementation of hook_token_list().
File
- includes/
name.token.inc, line 11 - Provides the hooks required for Token module integration.
Code
function _name_token_list($type = 'all') {
$tokens = array();
$tokens['name']['formatted'] = t('default - depreciated');
$tokens['name']['default'] = t('default');
$tokens['name']['raw'] = t('default - raw');
$tokens['name']['plain'] = t('default - plain');
foreach (name_get_custom_format_options() as $machine_name => $name_title) {
$tokens['name']['formatted-' . $machine_name] = t('%title', array(
'%title' => $name_title,
));
$tokens['name']['formatted-' . $machine_name . '-raw'] = t('%title - raw', array(
'%title' => $name_title,
));
$tokens['name']['formatted-' . $machine_name . '-plain'] = t('%title - plain', array(
'%title' => $name_title,
));
}
foreach (_name_translations() as $key => $title) {
$tokens['name'][$key . '-formatted'] = t('%part - depreciated', array(
'%part' => $title,
));
$tokens['name'][$key] = t('%part', array(
'%part' => $title,
));
$tokens['name'][$key . '-raw'] = t('%part - raw', array(
'%part' => $title,
));
$tokens['name'][$key . '-plain'] = t('%part - plain', array(
'%part' => $title,
));
}
return $tokens;
}