function video_field_widget_process in Video 7
Same name and namespace in other branches
- 7.2 video.field.inc \video_field_widget_process()
An element #process callback for the image_image field type.
Expands the image_image type to include the alt and title fields.
1 string reference to 'video_field_widget_process'
- video_field_widget_form in ./
video.field.inc - Implements hook_field_widget_form().
File
- ./
video.field.inc, line 322 - Implement an video field, based on the file module's file field.
Code
function video_field_widget_process($element, &$form_state, $form) {
$item = $element['#value'];
$item['fid'] = $element['fid']['#value'];
$field = field_widget_field($element, $form_state);
$instance = field_widget_instance($element, $form_state);
$settings = $field['settings'];
$element['#theme'] = 'video_widget';
$element['preview'] = array();
// Title is not necessary for each individual field.
if ($field['cardinality'] != 1) {
unset($element['#title']);
}
// add file elements by widget type
switch ($instance['widget']['type']) {
case 'video_upload':
break;
case 'video_ftp':
break;
}
// Add our extra fields if in preview mode
if (!empty($item['fid'])) {
video_widget_element_settings($element, $form_state);
// Create our thumbnails
video_thumb_process($element, $form_state);
}
return $element;
}