function realname_token_values in Real Name 5
Same name and namespace in other branches
- 6 realname_token.inc \realname_token_values()
File
- ./
token_realname.inc, line 22 - Token module support for the realname module.
Code
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;
}
}