You are here

function qtip_configure_instance_form_submit in qTip (Stylish jQuery Tooltips) 7.2

Submission handler.

File

includes/forms/qtip.admin.inc, line 405
Administrative functions for the qTip module.

Code

function qtip_configure_instance_form_submit(&$form, &$form_state) {
  if ($form_state['clicked_button']['#id'] == 'edit-actions-submit') {
    $qt = _qtip_convert_form_to_qtips($form_state);
    $exists = qtip_load($qt->machine_name);
    if ($exists && empty($exists->in_code_only)) {
      if (qtip_update($qt)) {
        drupal_set_message(t('The qTip instance %name has been updated.', array(
          '%name' => $qt->name,
        )));
      }
    }
    else {
      if (qtip_save($qt)) {
        drupal_set_message(t('The qTip instance %name has been created.', array(
          '%name' => $qt->name,
        )));
      }
    }
    $form_state['redirect'] = 'admin/config/user-interface/qtip';
  }
}