You are here

function uploadfield_elements in Video 6.4

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

Implementation of hook_elements().

File

types/uploadfield/uploadfield.module, line 45

Code

function uploadfield_elements() {

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

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