You are here

function domain_get_tokens in Domain Access 7.3

Returns all domain module tokens in a human-readable array.

The array key is the token string (without brackets) and the value is the token string : description.

Return value

An array of token data formatted as explained above.

1 call to domain_get_tokens()
domain_configure_form in ./domain.admin.inc
FormsAPI for configuring the domain module.

File

./domain.module, line 4231
Core module functions for the Domain Access suite.

Code

function domain_get_tokens($prefixes = array()) {
  if (empty($prefixes)) {
    $prefixes = array(
      'current-domain',
      'default-domain',
    );
  }
  module_load_include('inc', 'domain', 'domain.tokens');
  $info = domain_token_info();
  foreach ($prefixes as $prefix) {
    foreach ($info['tokens']['domain'] as $token => $data) {
      $tokens["{$prefix}:{$token}"] = t('!token : !description', array(
        '!token' => "[{$prefix}:{$token}]",
        '!description' => $data['description'],
      ));
    }
  }
  return $tokens;
}