Same name in other branches
  1. 7.x-3.x plugins/QuickQtabsContent.inc \QuickQtabsContent::optionsForm()

Overrides QuickContent::optionsForm

Fichier

src/Plugin/QuickContent/QuickQtabsContent.php, line 34

Classe

QuickQtabsContent
Class for tab content of type "qtabs" - this is for rendering a QuickSet instance as the tab content of another QuickSet instance. @QuicktabFormat{ id = "quickqtabscontent" }

Namespace

Drupal\quicktabs\Plugin\QuickContent

Code

public function optionsForm($delta, $qt, $form) {
    $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;
}