You are here

function ulogin_token_info in uLogin (advanced version) 7

Same name and namespace in other branches
  1. 8 ulogin.tokens.inc \ulogin_token_info()

Implements hook_token_info().

1 call to ulogin_token_info()
_ulogin_rules_data_properties in ./ulogin.rules.inc
1 string reference to 'ulogin_token_info'
_ulogin_rules_data_properties in ./ulogin.rules.inc

File

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

Code

function ulogin_token_info() {
  $types = array();
  $types['ulogin'] = array(
    'name' => t('uLogin data'),
    'description' => t('Information about the user from the uLogin service.'),
    'needs-data' => 'user',
  );
  $tokens = array();
  $tokens['user']['ulogin'] = array(
    'name' => t('uLogin information'),
    'description' => t('Information from uLogin service.'),
    'type' => 'ulogin',
  );
  $tokens['ulogin'] = array(
    'network' => array(
      'name' => t('Authentication provider'),
      'description' => t('Network providing authentication.'),
    ),
    'uid' => array(
      'name' => t('UID'),
      'description' => t('UID') . ' ' . t('provided by uLogin.'),
    ),
    'identity' => array(
      'name' => t('Identity'),
      'description' => t('Identity') . ' ' . t('provided by uLogin.'),
    ),
    'photo_processed' => array(
      'name' => t('Checked photo'),
      'description' => t('Big photo by default. If big photo is not available - then photo.'),
    ),
  );
  foreach (_ulogin_fields_list() as $key => $value) {
    $tokens['ulogin'][$key] = array(
      'name' => $value,
      'description' => $value . ' ' . t('provided by uLogin.'),
    );
  }
  return array(
    'types' => $types,
    'tokens' => $tokens,
  );
}