public function views_handler_argument_comment_user_uid::title in Views (for Drupal 7) 7.3
Same name and namespace in other branches
- 6.3 modules/comment/views_handler_argument_comment_user_uid.inc \views_handler_argument_comment_user_uid::title()
- 6.2 modules/comment/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
- modules/
comment/ views_handler_argument_comment_user_uid.inc, line 19 - 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
public function title() {
if (!$this->argument) {
$title = variable_get('anonymous', t('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);
}