You are here

function wysiwyg_template_form_node_type_form_submit in Wysiwyg API template plugin 7.2

1 string reference to 'wysiwyg_template_form_node_type_form_submit'
wysiwyg_template_form_node_type_form_alter in ./wysiwyg_template.module
Implements hook_form_FORM_ID_alter().

File

./wysiwyg_template.module, line 507
Makes TinyMCE Templates available as plugin for client-side editors integrated via Wysiwyg API.

Code

function wysiwyg_template_form_node_type_form_submit($form, $form_state) {
  $name = $form_state['values']['wysiwyg_template_default'];
  $type = $form_state['values']['type'];
  if (!empty($name)) {
    db_merge('wysiwyg_templates_default')
      ->key(array(
      'type' => $type,
    ))
      ->fields(array(
      'name' => $name,
      'type' => $type,
    ))
      ->execute();
  }
  else {
    db_delete('wysiwyg_templates_default')
      ->condition('type', $type)
      ->execute();
  }
}