You are here

function views_handler_field_username in Views (for Drupal 7) 5

2 string references to 'views_handler_field_username'
comment_views_tables in modules/views_comment.inc
This include file implements views functionality on behalf of comment.module
user_views_tables in modules/views_user.inc
This include file implements views functionality on behalf of user.module

File

modules/views_user.inc, line 222

Code

function views_handler_field_username($fieldinfo, $fielddata, $value, $data) {
  $obj = new stdClass();
  $uidfield = $fielddata['tablename'] . "_" . $fieldinfo['uid'];
  if (!$value && $data->{$uidfield}) {
    $obj = user_load(array(
      'uid' => $data->{$uidfield},
    ));
  }
  else {
    $obj->name = $value;
    $obj->uid = $data->{$uidfield};
  }
  return theme('username', $obj);
}