You are here

function imagefield_elements in ImageField 6.3

Implementation of hook_elements().

File

./imagefield.module, line 64

Code

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

  // Catch problems when this is called too early during installation or update.
  if (!module_exists('filefield')) {
    return $elements;
  }

  // An ImageField is really just a FileField with extra processing.
  $filefield_elements = module_invoke('filefield', 'elements');
  $elements['imagefield_widget'] = $filefield_elements['filefield_widget'];
  $elements['imagefield_widget']['#process'][] = 'imagefield_widget_process';

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