function views_handler_argument_comment_user_uid::title in Views (for Drupal 7) 6.3
Same name and namespace in other branches
- 6.2 modules/comment/views_handler_argument_comment_user_uid.inc \views_handler_argument_comment_user_uid::title()
- 7.3 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 10
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 = variable_get('anonymous', t('Anonymous'));
}
else {
$title = db_result(db_query("SELECT u.name FROM {users} u WHERE u.uid = %d", $this->argument));
}
if (empty($title)) {
return t('No user');
}
return check_plain($title);
}