You are here

function qt_remove_tab_submit in Quick Tabs 6.3

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

Submit handler for the "Remove Tab" button.

1 string reference to 'qt_remove_tab_submit'
_quicktabs_form in includes/admin.inc

File

includes/admin.inc, line 439

Code

function qt_remove_tab_submit($form, &$form_state) {

  // Get the tab delta for the clicked button.
  $delta = $form_state['clicked_button']['#parents'][1];

  // Copy the form_state because unset() does not work on variable
  // that is passed by reference.
  $form_state_copy = $form_state;
  unset($form_state_copy['values']['tabs'][$delta]);
  $quicktabs = _quicktabs_convert_form_to_quicktabs($form_state_copy);
  unset($form_state['submit_handlers']);
  form_execute_handlers('submit', $form, $form_state);
  $form_state['quicktabs'] = $quicktabs;
  $form_state['rebuild'] = TRUE;
}