You are here

function manualcrop_field_attach_submit in Manual Crop 7

Implements hook_field_attach_submit().

File

./manualcrop.module, line 274

Code

function manualcrop_field_attach_submit($entity_type, $entity, $form, &$form_state) {
  if (!user_access('use manualcrop')) {

    // The user is not allowed to crop images.
    return;
  }
  if (isset($form['#form_id']) && $form['#form_id'] === 'file_entity_edit' && module_exists('file_entity_revisions')) {

    // Skip the file_entity_edit form because it may use revisions and
    // we want to save our crop data when the revision id is known.
    return;
  }
  manualcrop_croptool_submit($form, $form_state);
}