You are here

function uploadfield_elements in Video 6.3

Same name and namespace in other branches
  1. 6.5 types/uploadfield/uploadfield.module \uploadfield_elements()
  2. 6.4 types/uploadfield/uploadfield.module \uploadfield_elements()

Implementation of hook_elements().

File

types/uploadfield/uploadfield.module, line 141

Code

function uploadfield_elements() {
  $elements = array();

  // An uploadfield is really just a FileField with extra processing.
  $filefield_elements = module_invoke('filefield', 'elements');
  $elements['uploadfield_widget'] = $filefield_elements['filefield_widget'];
  $elements['uploadfield_widget']['#process'][] = 'uploadfield_widget_process';
  $elements['uploadfield_widget']['#element_validate'][] = 'uploadfield_widget_validate';

  // uploadfield needs a separate value callback to save its alt and title texts.
  $elements['uploadfield_widget']['#value_callback'] = 'uploadfield_widget_value';
  return $elements;
}