You are here

function manualcrop_widget_process in Manual Crop 7

Process function for Manual Crop enabled widgets.

Parameters

$element: The form element.

$form_state: The form state array.

$form: The complete form.

Return value

Altered widget element.

1 string reference to 'manualcrop_widget_process'
manualcrop_field_widget_form_alter in ./manualcrop.module
Implements hook_field_widget_form_alter().

File

./manualcrop.module, line 315

Code

function manualcrop_widget_process($element, &$form_state, $form) {
  if (!empty($element['#file']) && user_access('use manualcrop')) {

    // Get the field instance and add the croptool.
    $instance = field_info_instance($element['#entity_type'], $element['#field_name'], $element['#bundle']);
    manualcrop_croptool_process($form, $form_state, $element, $element['#file'], array(), $instance);
  }
  return $element;
}