You are here

function quicktabs_form_submit in Quick Tabs 7.3

Same name and namespace in other branches
  1. 5 quicktabs.module \quicktabs_form_submit()
  2. 6.3 includes/admin.inc \quicktabs_form_submit()
  3. 6 quicktabs.module \quicktabs_form_submit()
  4. 6.2 includes/admin.inc \quicktabs_form_submit()
  5. 7.2 includes/admin.inc \quicktabs_form_submit()

Submit handler for quicktabs admin page.

File

./quicktabs.admin.inc, line 487
Provides the Quicktabs administrative interface.

Code

function quicktabs_form_submit($form, &$form_state) {
  if ($form_state['clicked_button']['#id'] == 'edit-submit-form') {
    $qt = _quicktabs_convert_form_to_quicktabs($form_state);
    $exists = quicktabs_load($qt->machine_name);
    if ($exists && empty($exists->in_code_only)) {
      if (quicktabs_update($qt)) {
        drupal_set_message(t('The Quicktabs instance has been updated.'));
      }
    }
    else {
      if (quicktabs_save($qt)) {
        drupal_set_message(t('The Quicktabs instance has been created.'));
      }
    }
    $form_state['redirect'] = 'admin/structure/quicktabs';
  }
}