You are here

public function views_handler_field_comment_username::render_link in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 modules/comment/views_handler_field_comment_username.inc \views_handler_field_comment_username::render_link()
  2. 6.2 modules/comment/views_handler_field_comment_username.inc \views_handler_field_comment_username::render_link()
1 call to views_handler_field_comment_username::render_link()
views_handler_field_comment_username::render in modules/comment/views_handler_field_comment_username.inc
Render the field.

File

modules/comment/views_handler_field_comment_username.inc, line 48
Definition of views_handler_field_comment_username.

Class

views_handler_field_comment_username
Field handler to allow linking to a user account or homepage.

Code

public function render_link($data, $values) {
  if (!empty($this->options['link_to_user'])) {
    $account = new stdClass();
    $account->uid = $this
      ->get_value($values, 'uid');
    $account->name = $this
      ->get_value($values);
    $account->homepage = $this
      ->get_value($values, 'homepage');
    return theme('username', array(
      'account' => $account,
    ));
  }
  else {
    return $data;
  }
}