You are here

function manualcrop_form_file_entity_add_upload_alter in Manual Crop 7

Implements hook_form_FORM_ID_alter().

Provides integration with the File Entity (and Media) module by adding the crop functionality to the file upload form.

File

./manualcrop.module, line 1004

Code

function manualcrop_form_file_entity_add_upload_alter(&$form, &$form_state) {
  if ($form['#step'] == 4 && isset($form['#entity']) && $form['#entity']->type == 'image' && user_access('use manualcrop')) {

    // Get the field instance information.
    $instance_info = array();
    if (!empty($form_state['build_info']['args'][0]['manualcrop'])) {
      $instance_info = $form_state['build_info']['args'][0]['manualcrop'];
    }

    // Process the form.
    _manualcrop_process_file_entity_form($form, $form_state, $instance_info);
  }
}