You are here

function name_replacement_tokens in Name Field 7

Same name and namespace in other branches
  1. 6 includes/name.parser.inc \name_replacement_tokens()

Provides the tokens that the name parse can handle.

@todo make the labels generic.

1 call to name_replacement_tokens()
theme_name_format_parameter_help in includes/name.parser.inc
Provides help to the characters that are recognized in the name_format() format parameter string.

File

includes/name.parser.inc, line 29
Provides the functionality and information about the Name module name parsing engine.

Code

function name_replacement_tokens() {
  $tokens = array(
    't' => t('Title'),
    'p' => t('Preferred name, use given name if not set.'),
    'q' => t('Preferred name.'),
    'g' => t('Given name'),
    'm' => t('Middle name(s)'),
    'f' => t('Family name'),
    'c' => t('Credentials'),
    's' => t('Generational suffix'),
    'v' => t('First letter preferred name.'),
    'w' => t('First letter preferred or given name.'),
    'x' => t('First letter given'),
    'y' => t('First letter middle'),
    'z' => t('First letter family'),
    'd' => t('Conditional: Either the preferred given or family name. Preferred name is given preference over given or family names.'),
    'D' => t('Conditional: Either the preferred given or family name. Family name is given preference over preferred or given names.'),
    'e' => t('Conditional: Either the given or family name. Given name is given preference.'),
    'E' => t('Conditional: Either the given or family name. Family name is given preference.'),
    'i' => t('Separator 1'),
    'j' => t('Separator 2'),
    'k' => t('Separator 3'),
    '\\' => t('You can prevent a character in the format string from being expanded by escaping it with a preceding backslash.'),
    'L' => t('Modifier: Converts the next token to all lowercase.'),
    'U' => t('Modifier: Converts the next token to all uppercase.'),
    'F' => t('Modifier: Converts the first letter to uppercase.'),
    'G' => t('Modifier: Converts the first letter of ALL words to uppercase.'),
    'T' => t('Modifier: Trims whitespace around the next token.'),
    'S' => t('Modifier: Ensures that the next token is safe for the display.'),
    '+' => t('Conditional: Insert the token if both the surrounding tokens are not empty.'),
    '-' => t('Conditional: Insert the token if the previous token is not empty'),
    '~' => t('Conditional: Insert the token if the previous token is empty'),
    '=' => t('Conditional: Insert the token if the next token is not empty.'),
    '^' => t('Conditional: Insert the token if the next token is empty.'),
    '|' => t('Conditional: Uses the previous token unless empty, otherwise it uses this token.'),
    '(' => t('Group: Start of token grouping.'),
    ')' => t('Group: End of token grouping.'),
  );
  return $tokens;
}