Same name and namespace in other branches
  1. 7.x-1.x colorbox.module \colorbox_field_formatter_view() 1 comment

Implements hook_field_formatter_view().

File

./colorbox.module, line 533

Code

function colorbox_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
    $element = array();
    $index = $display['settings']['colorbox_multivalue_index'];
    foreach ($items as $delta => $item) {
        if ($index === NULL || $index === $delta) {
            $element[$delta] = array(
                '#theme' => 'colorbox_image_formatter',
                '#item' => $item,
                '#entity_type' => $entity_type,
                '#entity' => $entity,
                // Left for legacy support.
'#node' => $entity,
                '#field' => $field,
                '#display_settings' => $display['settings'],
                '#delta' => $delta,
            );
        }
    }
    return $element;
}