You are here

function textimage_preset_edit_submit in Textimage 6.2

Same name and namespace in other branches
  1. 5.2 textimage_admin.inc \textimage_preset_edit_submit()
  2. 5 textimage.module \textimage_preset_edit_submit()
  3. 7.2 textimage.admin.inc \textimage_preset_edit_submit()

File

./textimage_admin.inc, line 555

Code

function textimage_preset_edit_submit($form, &$form_state) {
  _textimage_preset_flush(0);
  if (!isset($form_state['values']['pid'])) {
    $return = _textimage_preset_create($form_state['values']['name'], $form_state['values']['description'], $form_state['values']['settings']);
  }
  elseif (is_numeric($form_state['values']['pid'])) {
    $return = _textimage_preset_update($form_state['values']['pid'], $form_state['values']['name'], $form_state['values']['description'], $form_state['values']['settings']);
  }
  if ($return) {
    _textimage_flush_cache();
    drupal_set_message(t('Updated preset %name', array(
      '%name' => $form_state['values']['name'],
    )));
    drupal_goto('admin/build/textimage/preset/list');
  }
  else {
    drupal_set_message(t('The preset was unable to be updated.'), 'error');
  }
}