You are here

public function AreaPluginBase::buildOptionsForm in Views (for Drupal 7) 8.3

Default options form that provides the label widget that all fields should have.

Overrides HandlerBase::buildOptionsForm

4 calls to AreaPluginBase::buildOptionsForm()
Result::buildOptionsForm in lib/Drupal/views/Plugin/views/area/Result.php
Default options form that provides the label widget that all fields should have.
Text::buildOptionsForm in lib/Drupal/views/Plugin/views/area/Text.php
Default options form that provides the label widget that all fields should have.
Title::buildOptionsForm in lib/Drupal/views/Plugin/views/area/Title.php
Overrides Drupal\views\Plugin\views\AreaPluginBase::buildOptionsForm().
View::buildOptionsForm in lib/Drupal/views/Plugin/views/area/View.php
Default options form that provides the label widget that all fields should have.
5 methods override AreaPluginBase::buildOptionsForm()
Broken::buildOptionsForm in lib/Drupal/views/Plugin/views/area/Broken.php
Default options form that provides the label widget that all fields should have.
Result::buildOptionsForm in lib/Drupal/views/Plugin/views/area/Result.php
Default options form that provides the label widget that all fields should have.
Text::buildOptionsForm in lib/Drupal/views/Plugin/views/area/Text.php
Default options form that provides the label widget that all fields should have.
Title::buildOptionsForm in lib/Drupal/views/Plugin/views/area/Title.php
Overrides Drupal\views\Plugin\views\AreaPluginBase::buildOptionsForm().
View::buildOptionsForm in lib/Drupal/views/Plugin/views/area/View.php
Default options form that provides the label widget that all fields should have.

File

lib/Drupal/views/Plugin/views/area/AreaPluginBase.php, line 75
Definition of Drupal\views\Plugin\views\area\AreaPluginBase.

Class

AreaPluginBase
Base class for area handlers.

Namespace

Drupal\views\Plugin\views\area

Code

public function buildOptionsForm(&$form, &$form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['label'] = array(
    '#type' => 'textfield',
    '#title' => t('Label'),
    '#default_value' => isset($this->options['label']) ? $this->options['label'] : '',
    '#description' => t('The label for this area that will be displayed only administratively.'),
  );
  if ($form_state['type'] != 'empty') {
    $form['empty'] = array(
      '#type' => 'checkbox',
      '#title' => t('Display even if view has no result'),
      '#default_value' => isset($this->options['empty']) ? $this->options['empty'] : 0,
    );
  }
}