function group_token_info in Group 8
Same name and namespace in other branches
- 2.0.x group.tokens.inc \group_token_info()
Implements hook_token_info().
File
- ./
group.tokens.inc, line 15 - Builds placeholder replacement tokens for group-related data.
Code
function group_token_info() {
$types['group'] = [
'name' => t('Group'),
'description' => t('Tokens related to individual groups.'),
'needs-data' => 'group',
];
$tokens['group']['id'] = [
'name' => t('Group ID'),
'description' => t('The unique ID of the group.'),
];
$tokens['group']['uuid'] = [
'name' => t('Group UUID'),
'description' => t('The universally unique ID of the group.'),
];
$tokens['group']['type'] = [
'name' => t('Group type'),
'description' => t('The machine name of the group type.'),
];
$tokens['group']['type-name'] = [
'name' => t('Group type name'),
'description' => t('The human-readable name of the group type.'),
];
$tokens['group']['title'] = [
'name' => t('Title'),
];
$tokens['group']['langcode'] = [
'name' => t('Language code'),
'description' => t('The language code of the language the group is in.'),
];
$tokens['group']['url'] = [
'name' => t('URL'),
'description' => t('The URL of the group.'),
];
$tokens['group']['edit-url'] = [
'name' => t('Edit URL'),
'description' => t("The URL of the group's edit page."),
];
$tokens['group']['created'] = [
'name' => t('Date created'),
'type' => 'date',
];
$tokens['group']['changed'] = [
'name' => t('Date changed'),
'description' => t('The date the group was most recently updated.'),
'type' => 'date',
];
$tokens['group']['author'] = [
'name' => t('Author'),
'type' => 'user',
];
$types['group_content'] = [
'name' => t('Group content'),
'description' => t('Tokens related to the relationships between a group and its content.'),
'needs-data' => 'group_content',
];
$tokens['group_content']['id'] = [
'name' => t('Group content ID'),
'description' => t('The unique ID of the group content.'),
];
$tokens['group_content']['langcode'] = [
'name' => t('Language code'),
'description' => t('The language code of the language the group content is in.'),
];
$tokens['group_content']['url'] = [
'name' => t('URL'),
'description' => t('The URL of the group content.'),
];
$tokens['group_content']['edit-url'] = [
'name' => t('Edit URL'),
'description' => t("The URL of the group's edit page."),
];
$tokens['group_content']['created'] = [
'name' => t('Date created'),
'type' => 'date',
];
$tokens['group_content']['changed'] = [
'name' => t('Date changed'),
'description' => t('The date the group content was most recently updated.'),
'type' => 'date',
];
$tokens['group_content']['group'] = [
'name' => t('Group'),
'type' => 'group',
];
$tokens['group_content']['pretty-path-key'] = [
'name' => t('Pretty path key'),
'description' => t('A prettier way of labeling group content of the same plugin type.'),
];
return [
'types' => $types,
'tokens' => $tokens,
];
}