function mail_edit_template_form_save in Mail Editor 7
Submit handler to save the template edit form.
_state
Parameters
array $form:
Return value
void
1 string reference to 'mail_edit_template_form_save'
- mail_edit_template_form in ./
mail_edit.admin.inc - Form builder function to prepare the template edit form.
File
- ./
mail_edit.admin.inc, line 599 - Administrative interface for the Mail Editor module.
Code
function mail_edit_template_form_save(array $form, array &$form_state) {
$values = $form_state['values'];
$success = drupal_write_record('mail_edit', $values, $values['update'] ? array(
'id',
'language',
) : array());
$language_list = mail_edit_language_list();
$variables = array(
'%id' => $values['id'],
'%language' => $language_list[$values['language']],
);
if ($success) {
drupal_set_message(t('Saved the %id template for the %language translation.', $variables));
}
$form_state['redirect'] = 'admin/config/system/mail-edit';
}