You are here

function video_embed_field_field_formatter_view in Video Embed Field 7

Same name and namespace in other branches
  1. 7.2 video_embed_field.field.inc \video_embed_field_field_formatter_view()

implementation of hook_field_widget_form

File

./video_embed_field.module, line 241

Code

function video_embed_field_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();
  foreach ($items as $delta => $item) {
    if (isset($item['description']) && $item['description']) {
      $description = array(
        '#prefix' => '<div class="video-embed-description">',
        '#markup' => $item['description'],
        '#suffix' => '</div>',
      );
    }
    else {
      $description = array();
    }
    $element[$delta] = array(
      array(
        '#markup' => $item['embed_code'],
      ),
      $description,
    );
  }
  return $element;
}