You are here

function oa_core_get_user_picture_for_views_fields in Open Atrium Core 7.2

Helper function to find the correct image style depending on the field.

@todo: Figure out why we have two different User:picture fields being used.

Parameters

object $field: The field being rendered in the view.

Return value

string

1 call to oa_core_get_user_picture_for_views_fields()
oa_core_preprocess_views_view_fields in ./oa_core.module
Implements hook_preprocess_views_view_fields().

File

./oa_core.module, line 804

Code

function oa_core_get_user_picture_for_views_fields($field) {

  // Set a default image style.
  $image_style = 'oa_small_thumbnail';

  // Allow the image style setting to overwrite the default.
  if (isset($field->handler->options['settings']['image_style'])) {
    $image_style = $field->handler->options['settings']['image_style'];
  }
  if (isset($field->handler->options['image_style'])) {
    $image_style = $field->handler->options['image_style'];
  }

  // Add the user placeholder image.
  return oa_users_picture(NULL, $image_style);
}