You are here

function galleria_prepare_media_images in Galleria 7

Util function to parse media $items and return images in format expected by galleria formatter.

Parameters

array $items: Array of field items.

1 call to galleria_prepare_media_images()
galleria_field_formatter_view in ./galleria.module
Implements hook_field_formatter_view().

File

./galleria.module, line 605
A light-weight, customizable image gallery plugin for Drupal based on jQuery

Code

function galleria_prepare_media_images($items) {
  $image_items = array();
  foreach ($items as $item) {
    if ($item['file']->type == 'image') {
      $file = (array) $item['file'];
      $file += array(
        'alt' => '',
        'title' => '',
      );
      $image_items[] = $file;
    }
  }
  return $image_items;
}