You are here

function textimage_preset_edit_submit in Textimage 5.2

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

File

./textimage_admin.inc, line 551

Code

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