function video_field_presave in Video 7.2
Same name and namespace in other branches
- 7 video.field.inc \video_field_presave()
Implements hook_field_presave().
File
- ./
video.field.inc, line 429 - Implement a video field, based on the file module's file field.
Code
function video_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
// change the thumbnails if default is checked
foreach ($items as $delta => $item) {
if (!empty($field['settings']['default_video_thumbnail']['fid'])) {
if (!empty($item['use_default_video_thumb'])) {
$items[$delta]['thumbnail'] = $field['settings']['default_video_thumbnail']['fid'];
}
}
}
file_field_presave($entity_type, $entity, $field, $instance, $langcode, $items);
}