You are here

function video_field_presave in Video 7

Same name and namespace in other branches
  1. 7.2 video.field.inc \video_field_presave()

Implements hook_field_presave().

File

./video.field.inc, line 133
Implement an video field, based on the file module's file field.

Code

function video_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {

  // change the theumbnails if default is checked
  if (!empty($field['settings']['default_video_thumbnail'])) {
    foreach ($items as $delta => $item) {
      if ($item['use_default_video_thumb']) {
        $items[$delta]['thumbnail'] = $field['settings']['default_video_thumbnail']['fid'];
      }
    }
  }
  file_field_presave($entity_type, $entity, $field, $instance, $langcode, $items);
}