You are here

function domain_token_list in Domain Access 6.2

Implement hook_token_list().

File

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

Code

function domain_token_list($type = 'all') {
  $tokens = array();
  if ($type == 'global' || $type == 'all') {

    // Current domain tokens.
    $tokens['domain']['domain-id'] = t('The current domain ID.');
    $tokens['domain']['domain-name'] = t('The current domain name, lowercased and with only alphanumeric characters.');
    $tokens['domain']['domain-name-raw'] = t('The current domain name. WARNING - raw user input. NOT path safe.');
    $tokens['domain']['domain-url'] = t('The current domain\'s URL, lowercased and with only alphanumeric characters.');
    $tokens['domain']['domain-url-raw'] = t('The current domain\'s URL. WARNING - raw user input. NOT path safe.');
    $tokens['domain']['domain-subdomain'] = t('The current subdomain, lowercased and with only alphanumeric characters. Only works with *.example.com formats');
    $tokens['domain']['domain-subdomain-raw'] = t('The current subdomain. Only works with *.example.com formats. WARNING - raw user input. NOT path safe.');

    // Default domain tokens.
    $tokens['domain']['domain-default-id'] = t('The default domain ID.');
    $tokens['domain']['domain-default-name'] = t('The default domain name, lowercased and with only alphanumeric characters.');
    $tokens['domain']['domain-default-name-raw'] = t('The default domain name. WARNING - raw user input. NOT path safe.');
    $tokens['domain']['domain-default-url'] = t('The default domain\'s URL, lowercased and with only alphanumeric characters.');
    $tokens['domain']['domain-default-url-raw'] = t('The default domain\'s URL. WARNING - raw user input. NOT path safe.');
  }
  return $tokens;
}