Overrides User::render_link
function render_link($data, $values) {
$account = entity_create('user', array());
$account->uid = $this
->get_value($values, 'uid');
$account->name = $this
->get_value($values);
if (!empty($this->options['link_to_user']) || !empty($this->options['overwrite_anonymous'])) {
if (!empty($this->options['overwrite_anonymous']) && !$account->uid) {
// This is an anonymous user, and we're overriting the text.
return check_plain($this->options['anonymous_text']);
}
elseif (!empty($this->options['link_to_user'])) {
$account->name = $this
->get_value($values);
return theme('username', array(
'account' => $account,
));
}
}
// If we want a formatted username, do that.
if (!empty($this->options['format_username'])) {
return user_format_name($account);
}
// Otherwise, there's no special handling, so return the data directly.
return $data;
}