function views_handler_field_user_picture::render in Views (for Drupal 7) 6.3
Same name and namespace in other branches
- 6.2 modules/user/views_handler_field_user_picture.inc \views_handler_field_user_picture::render()
- 7.3 modules/user/views_handler_field_user_picture.inc \views_handler_field_user_picture::render()
Render the field.
Parameters
$values: The values retrieved from the database.
Overrides views_handler_field::render
File
- modules/
user/ views_handler_field_user_picture.inc, line 54
Class
- views_handler_field_user_picture
- Field handler to provide simple renderer that allows using a themed user link.
Code
function render($values) {
// Fake an account object.
$account = new stdClass();
if ($this->options['link_photo_to_profile']) {
// Prevent template_preprocess_user_picture from adding a link
// by not setting the uid.
$account->uid = $this
->get_value($values, 'uid');
}
$account->name = $this
->get_value($values, 'name');
$account->mail = $this
->get_value($values, 'mail');
$account->picture = $this
->get_value($values);
return theme('user_picture', $account);
}