You are here

function imagefield_crop_field_widget_form in Imagefield Crop 7.2

Same name and namespace in other branches
  1. 7.3 imagefield_crop.module \imagefield_crop_field_widget_form()
  2. 7 imagefield_crop.module \imagefield_crop_field_widget_form()

Implements hook_field_widget_form().

File

./imagefield_crop.module, line 668
Functionality and Drupal hook implementations for the Imagefield Crop module.

Code

function imagefield_crop_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
  $elements = image_field_widget_form($form, $form_state, $field, $instance, $langcode, $items, $delta, $element);
  foreach (element_children($elements) as $delta) {
    $elements[$delta]['#value_callback'] = 'imagefield_crop_value_callback';

    // Add all extra functionality provided by the imagefield_crop widget.
    $elements[$delta]['#process'][] = 'imagefield_crop_widget_process';
    $elements[$delta]['#upload_validators']['imagefield_crop_upload_validate'] = array(
      $field,
      $instance,
    );
  }
  return $elements;
}