Same name in other branches
- 7.x-3.x plugins/QuickViewContent.inc \QuickViewContent::optionsForm()
Overrides QuickContent::optionsForm
Fichier
-
src/
Plugin/ QuickContent/ QuickViewContent.php, line 38
Classe
- QuickViewContent
- Class for tab content of type "view" - this is for rendering a view as tab content. @QuicktabFormat{ id = "quickviewcontent" }
Namespace
Drupal\quicktabs\Plugin\QuickContentCode
public function optionsForm($delta, $qt, $form) {
$tab = $this->settings;
$form = array();
$views = quicktabs_get_views();
$views_keys = array_keys($views);
$selected_view = isset($tab['vid']) ? $tab['vid'] : (isset($views_keys[0]) ? $views_keys[0] : '');
$form['view']['vid'] = array(
'#type' => 'select',
'#options' => $views,
'#default_value' => $selected_view,
'#title' => t('Select a view'),
'#ajax' => array(
'callback' => '_quicktabs_replace_view_displays_callback',
),
);
$form['view']['display'] = array(
'#type' => 'select',
'#title' => 'display',
'#options' => _quicktabs_get_views_displays($selected_view),
'#default_value' => isset($tab['display']) ? $tab['display'] : '',
'#prefix' => '<div id="view-display-dropdown-' . $delta . '">',
'#suffix' => '</div>',
);
$form['view']['args'] = array(
'#type' => 'textfield',
'#title' => 'arguments',
'#size' => '40',
'#required' => FALSE,
'#default_value' => isset($tab['args']) ? $tab['args'] : '',
'#description' => t('Additional arguments to send to the view as if they were part of the URL in the form of arg1/arg2/arg3. You may use %0, %1, ..., %N to grab arguments from the URL.'),
);
$form['view']['use_title'] = array(
'#type' => 'checkbox',
'#return_value' => TRUE,
'#title' => 'Use display title',
'#default_value' => isset($tab['use_title']) ? $tab['use_title'] : FALSE,
'#description' => t('Should quicktabs use the rendered title of the view?'),
);
return $form;
}