You are here

function imagefield_crop_field_load in Imagefield Crop 7.3

Same name and namespace in other branches
  1. 7.2 imagefield_crop.module \imagefield_crop_field_load()

Implements hook_field_load().

File

./imagefield_crop.module, line 94

Code

function imagefield_crop_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {
  file_field_load($entity_type, $entities, $field, $instances, $langcode, $items, $age);
  foreach ($items as $eid => &$entity) {
    foreach ($entity as $delta => &$item) {
      $entity_w = entity_metadata_wrapper($entity_type, $entities[$eid]);
      $key = $entity_w
        ->entityKey('revision') ? $entity_w
        ->entityKey('revision') : $entity_w
        ->entityKey('id');
      $item['crop_config'] = imagefield_crop_variants_load_multiple($item['fid'], $entities[$eid]->{$key});
    }
  }
}