You are here

token_realname.inc in Real Name 5

Token module support for the realname module.

File

token_realname.inc
View source
<?php

/**
 * @file
 *   Token module support for the realname module.
 */
function realname_token_list($type = 'all') {
  $tokens = array();
  switch ($type) {
    case 'user':
    case 'node':
    case 'all':
    case 'global':
    case 'comment':
      $tokens[$type]['realname'] = t('The RealName for the user.');
      $tokens[$type]['realname-link'] = t('Themed username link.');
      $tokens[$type]['homepage'] = t('The home page for the user.');
      return $tokens;
  }
}
function realname_token_values($type, $object = NULL, $options = array()) {
  global $user;
  $tokens = array();
  if (!$object) {
    $object = $user;
  }
  switch ($type) {
    case 'user':
    case 'node':

    //    case 'all':
    case 'global':
    case 'comment':
      $tokens['realname'] = realname_make_name($object);
      $tokens['realname-link'] = theme('username', $object);
      $tokens['homepage'] = isset($object->homepage) ? $object->homepage : NULL;
      return $tokens;
  }
}

Functions

Namesort descending Description
realname_token_list @file Token module support for the realname module.
realname_token_values