1 views_handler_argument_comment_user_uid.inc views_handler_argument_comment_user_uid::title()

Get the title this argument will assign the view, given the argument.

This usually needs to be overridden to provide a proper title.

Overrides views_handler_argument::title

File

core/modules/comment/views/views_handler_argument_comment_user_uid.inc, line 14
Definition of views_handler_argument_comment_user_uid.

Class

views_handler_argument_comment_user_uid
Argument handler to accept a user id to check for nodes that user posted or commented on.

Code

function title() {
  if (!$this->argument) {
    $title = config_get_translated('system.core', 'anonymous');
  }
  else {
    $title = db_query('SELECT u.name FROM {users} u WHERE u.uid = :uid', array(':uid' => $this->argument))->fetchField();
  }
  if (empty($title)) {
    return t('No user');
  }

  return check_plain($title);
}