You are here

function textimage_preset_edit_submit in Textimage 5

Same name and namespace in other branches
  1. 5.2 textimage_admin.inc \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.module, line 521

Code

function textimage_preset_edit_submit($form_id, $form_values) {
  if ($form_values['preset_id'] == 'new') {
    $return = _textimage_preset_create($form_values['name'], $form_values['settings']);
  }
  elseif (is_numeric($form_values['preset_id'])) {
    $return = _textimage_preset_update($form_values['preset_id'], $form_values['name'], $form_values['settings']);
  }
  if ($return) {
    drupal_set_message(t('Updated preset %name', array(
      '%name' => $form_values['name'],
    )));
    drupal_goto('admin/settings/textimage/list');
  }
  else {
    drupal_set_message(t('The preset was unable to be updated.', 'error'));
  }
}