You are here

public function QuickQtabsContent::optionsForm in Quick Tabs 7.3

Method for returning the form elements to display for this tab type on the admin form.

Parameters

$delta Integer representing this tab's position in the tabs array.:

$qt An object representing the Quicktabs instance that the tabs are: being built for.

Overrides QuickContent::optionsForm

File

plugins/QuickQtabsContent.inc, line 13

Class

QuickQtabsContent
Class for tab content of type "qtabs" - this is for rendering a QuickSet instance as the tab content of another QuickSet instance.

Code

public function optionsForm($delta, $qt) {
  $tab = $this->settings;
  $form = array();
  $tab_options = array();
  foreach (quicktabs_load_multiple() as $machine_name => $info) {

    // Do not offer the option to put a tab inside itself.
    if (!isset($qt->machine_name) || $machine_name != $qt->machine_name) {
      $tab_options[$machine_name] = $info->title;
    }
  }
  $form['qtabs']['machine_name'] = array(
    '#type' => 'select',
    '#title' => t('Quicktabs instance'),
    '#description' => t('The Quicktabs instance to put inside this tab.'),
    '#options' => $tab_options,
    '#default_value' => isset($tab['machine_name']) ? $tab['machine_name'] : '',
  );
  return $form;
}