You are here

function imagefield_crop_get_renderable in Imagefield Crop 7.3

Implements property callback imagefield_crop_get_renderable().

Parameters

$data:

$options:

$name:

$type:

$info:

Return value

array|string

1 string reference to 'imagefield_crop_get_renderable'
entity_metadata_field_imagefield_crop_callback in ./imagefield_crop.module
Additional callback to adapt the property info for image fields. This callback gets invoked after entity_metadata_field_file_callback().

File

./imagefield_crop.module, line 66

Code

function imagefield_crop_get_renderable($data, $options, $name, $type, &$info) {

  // Set contextual info useful for getters of any child properties.
  $field_info = $info['parent']
    ->info();
  $instance = $field_info['instance'];
  $entity = $field_info['parent']
    ->value();
  $entity_type = $field_info['parent']
    ->type();
  $langcode = isset($options['language']) ? $options['language']->language : LANGUAGE_NONE;
  $langcode = entity_metadata_field_get_language($entity_type, $entity, $field_info['field'], $langcode, TRUE);
  return imagefield_crop_field_formatter_view($entity_type, $entity, $field_info['field'], $instance, $langcode, array(
    $data,
  ), reset($instance['display']));
}