You are here

function imagecrop_javascript_effect_submit in Image javascript crop 7

Reset the cropped images when the reset checkbox is enabled.

1 string reference to 'imagecrop_javascript_effect_submit'
imagecrop_form_image_effect_form_alter in ./imagecrop.module
Implements hook_form_image_effect_form_alter(). Add the reset checkbox when editing an effect.

File

includes/imagecrop.effects.inc, line 156
Registry for the image style effects from imagecrop.

Code

function imagecrop_javascript_effect_submit($form, &$form_state) {
  if ($form_state['values']['reset-crops'] === 1) {
    db_update('image_crop_settings')
      ->fields(array(
      'width' => $form_state['values']['data']['width'],
      'height' => $form_state['values']['data']['height'],
    ))
      ->condition('width', $form_state['values']['old-width'])
      ->condition('height', $form_state['values']['old-height'])
      ->condition('style_name', $form_state['image_style']['name'])
      ->execute();
  }
}