function ds_return_picture in Display Suite 7.2
Same name and namespace in other branches
- 7 ds.module \ds_return_picture()
Return the picture.
1 call to ds_return_picture()
- ds_render_user_picture in ./
ds.module - Render a user picture.
File
- ./
ds.module, line 1094 - Display Suite core functions.
Code
function ds_return_picture($entity) {
// Gravatar support.
if (module_exists('gravatar')) {
$entity = _gravatar_load_account($entity);
$entity->picture = _gravatar_get_account_user_picture($entity);
}
if (!empty($entity->picture)) {
if (is_numeric($entity->picture)) {
return file_load($entity->picture);
}
else {
return $entity->picture;
}
}
elseif (variable_get('user_picture_default', '')) {
return variable_get('user_picture_default', '');
}
}