You are here

function views_photo_grid_plugin_style::get_image_field_name in Views Photo Grid 7

Returns the name of the image field used in the view.

File

views/views_photo_grid_plugin_style.inc, line 39
Style plugin for Views Photo Grid.

Class

views_photo_grid_plugin_style
@file Style plugin for Views Photo Grid.

Code

function get_image_field_name() {
  $fields = $this->display->handler
    ->get_handlers('field');

  // Find the first non-excluded image field.
  foreach ($fields as $key => $field) {
    if (empty($field->options['exclude']) && !empty($field->field_info['type']) && $field->field_info['type'] == 'image') {
      return $key;
    }
  }
  return FALSE;
}