You are here

function domain_token_info in Domain Access 7.2

Same name and namespace in other branches
  1. 8 domain/domain.module \domain_token_info()
  2. 7.3 domain.tokens.inc \domain_token_info()

Implements hook_token_info().

File

./domain.tokens.inc, line 11
Builds placeholder replacement tokens for domain-related data.

Code

function domain_token_info() {

  // Domain token types.
  $info['types']['domain'] = array(
    'name' => t('Domains'),
    'description' => t('Tokens related to domains.'),
    'needs-data' => 'domain',
  );
  $info['types']['current-domain'] = array(
    'name' => t('Current domain'),
    'description' => t('Tokens related to the current domain.'),
    'type' => 'domain',
  );
  $info['types']['default-domain'] = array(
    'name' => t('Default domain'),
    'description' => t('Tokens related to the default domain.'),
    'type' => 'domain',
  );

  // Domain tokens.
  $info['tokens']['domain']['id'] = array(
    'name' => t('Domain id'),
    'description' => t('The domain ID.'),
  );
  $info['tokens']['domain']['name'] = array(
    'name' => t('Domain name'),
    'description' => t('The domain name.'),
  );
  $info['tokens']['domain']['url'] = array(
    'name' => t('Domain URL'),
    'description' => t('The domain\'s URL, lowercased and with only alphanumeric characters.'),
  );
  $info['tokens']['domain']['subdomain'] = array(
    'name' => t('Subdomain'),
    'description' => t('The subdomain, lowercased and with only alphanumeric characters. Only works with *.example.com formats'),
  );
  return $info;
}