Provide the default form for setting options.
Overrides DisplayPluginBase::buildOptionsForm
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
switch ($form_state['section']) {
case 'block_description':
$form['#title'] .= t('Block admin description');
$form['block_description'] = array(
'#type' => 'textfield',
'#description' => t('This will appear as the name of this block in administer >> structure >> blocks.'),
'#default_value' => $this
->getOption('block_description'),
);
break;
case 'block_caching':
$form['#title'] .= t('Block caching type');
$form['block_caching'] = array(
'#type' => 'radios',
'#description' => t("This sets the default status for Drupal's built-in block caching method; this requires that caching be turned on in block administration, and be careful because you have little control over when this cache is flushed."),
'#options' => $this
->blockCachingModes(),
'#default_value' => $this
->getCacheType(),
);
break;
case 'exposed_form_options':
$this->view
->initHandlers();
if (!$this
->usesExposed() && parent::usesExposed()) {
$form['exposed_form_options']['warning'] = array(
'#weight' => -10,
'#markup' => '<div class="messages messages--warning">' . t('Exposed filters in block displays require "Use AJAX" to be set to work correctly.') . '</div>',
);
}
}
}