You are here

function quicktabs_form in Quick Tabs 6.2

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

Build the quicktab creation and edit form.

2 string references to 'quicktabs_form'
quicktabs_clone in includes/admin.inc
Clone QuickTabs.
quicktabs_menu in ./quicktabs.module
Implementation of hook_menu().

File

includes/admin.inc, line 43

Code

function quicktabs_form($form_state, $formtype, $quicktabs = array()) {
  $form = _qt_admin_main_form($form_state, $quicktabs);
  if ($formtype == 'edit') {
    $form['qtid'] = array(
      '#type' => 'hidden',
      '#value' => isset($quicktabs['qtid']) ? $quicktabs['qtid'] : 0,
    );
  }
  $no_tabs = TRUE;
  if (empty($quicktabs['tabs'])) {
    $quicktabs['tabs'] = array(
      0 => array(),
      1 => array(),
    );
  }
  else {
    $no_tabs = FALSE;
    $tab_titles = array();
  }

  // Add the current tabs to the form.
  foreach ($quicktabs['tabs'] as $delta => $details) {
    $details['delta'] = $delta;
    $form['qt_wrapper']['tabs'][$delta] = _quicktabs_form($details);
    if (isset($details['title'])) {
      $tab_titles[$delta] = $details['title'];
    }
  }
  if (!$no_tabs) {
    $form['default_tab'] = array(
      '#type' => 'select',
      '#title' => t('Default tab'),
      '#options' => $tab_titles,
      '#default_value' => $quicktabs['default_tab'],
      '#weight' => -6,
    );
  }
  return $form;
}