You are here

function imagefield_crop_preset_form_submit in Imagefield Crop 7.3

1 string reference to 'imagefield_crop_preset_form_submit'
imagefield_crop_preset_form in ./imagefield_crop.module
Implements form builder imagefield_crop_preset_form().

File

./imagefield_crop.module, line 1158

Code

function imagefield_crop_preset_form_submit($form, &$form_state) {
  $l = l('preset list', 'admin/config/media/imagefield-crop-preset-list');
  if (!empty($form_state['preset'])) {
    $record = $form_state['preset'];
    $record->name = $form_state['values']['preset_name'];
    $record->data = $form_state['values']['preset'];
    drupal_write_record('imagefield_crop_preset', $record, 'pid');
    drupal_set_message(t('Preset successful updated. You can go to !lpreset', array(
      '!lpreset' => $l,
    )), 'status');
  }
  else {
    $record['name'] = $form_state['values']['preset_name'];
    $record['data'] = $form_state['values']['preset'];
    drupal_write_record('imagefield_crop_preset', $record);
    drupal_set_message(t('Preset successful added. You can go to !lpreset', array(
      '!lpreset' => $l,
    )), 'status');
  }
}