You are here

function ggroup_token_info in Subgroup (Graph) 1.0.x

Implements hook_token_info().

File

./ggroup.tokens.inc, line 21
Builds placeholder replacement tokens for group group-related data.

Code

function ggroup_token_info() {
  $tokens = [];
  $tokens['group'] = [
    'name' => t('Group'),
    'description' => t('The parent group.'),
    'type' => 'group',
  ];
  if (\Drupal::moduleHandler()
    ->moduleExists('token')) {
    $tokens['groups'] = [
      'name' => t('Groups'),
      'description' => t('An array of all the group parent groups.'),
      'type' => 'array',
    ];
  }
  return [
    'tokens' => [
      'group' => $tokens,
    ],
  ];
}