You are here

function uploadfield_widget_process in Video 6.5

Same name and namespace in other branches
  1. 6.3 types/uploadfield/uploadfield_widget.inc \uploadfield_widget_process()
  2. 6.4 types/uploadfield/uploadfield_widget.inc \uploadfield_widget_process()

Element #process callback function.

1 string reference to 'uploadfield_widget_process'
uploadfield_elements in types/uploadfield/uploadfield.module
Implementation of hook_elements().

File

types/uploadfield/uploadfield_widget.inc, line 108
uploadfield widget hooks and callbacks.

Code

function uploadfield_widget_process($element, $edit, &$form_state, $form) {
  $item = $element['#value'];
  $field_name = $element['#field_name'];
  $delta = $element['#delta'];
  $field = content_fields($element['#field_name'], $element['#type_name']);
  $element['#theme'] = 'uploadfield_widget_item';
  if (isset($element['preview']) && $element['#value']['fid'] != 0) {
    $element['preview']['#value'] = theme('video_widget_preview', $element['#value']);
  }

  // Create our thumbnails
  if ($field['widget']['autothumbnail']) {
    video_thumb_process($element);
  }

  // Add our extra fields if in preview mode
  if (!empty($item['fid'])) {
    video_widget_element_settings($element);
  }

  // Lets use the clicked_button #submit[0] value here instead and see how that works out for now...
  if ($form_state['submitted'] == 1) {
    video_widget_process($element, $form_state);
  }
  return $element;
}