You are here

function _exif_field_widget_retrieve_image_field_from_bundle in Exif 7

retrieve all image_field fields of the same content type (bundle)

Parameters

$bundle_name:

1 call to _exif_field_widget_retrieve_image_field_from_bundle()
exif_field_widget_settings_form in ./exif.module
Implementation of hook_widget_settings().

File

./exif.module, line 638

Code

function _exif_field_widget_retrieve_image_field_from_bundle($entity_type, $bundle_name) {
  $fields_of_bundle = field_info_instances($entity_type, $bundle_name);
  $result = array();
  foreach ($fields_of_bundle as $key => $value) {
    if (is_array($value) && is_array($value['widget']) && ($value['widget']['type'] == 'image_image' || $value['widget']['type'] == 'media_generic' || $value['widget']['type'] == 'image_miw')) {
      $result[$key] = $value['label'] . " (" . $key . ")";
    }
  }
  return $result;
}