You are here

function manualcrop_keepproportions_validate in Manual Crop 7

Element validation handler; validates the keepproportions checkbox from the crop effect form.

1 string reference to 'manualcrop_keepproportions_validate'
manualcrop_crop_form in ./manualcrop.admin.inc
Form builder; Configuration settings for crop effect.

File

./manualcrop.admin.inc, line 163
Admin functionality for the Manual Crop module.

Code

function manualcrop_keepproportions_validate($element, $form_state) {
  $values = $form_state['values']['data'];
  if ($values['keepproportions'] && (!$values['width'] || !$values['height'])) {
    form_set_error('data][keepproportions', t('Set a width and height if proportions should be maintained.'));
  }
}