You are here

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

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

Overrides HandlerBase::buildOptionsForm

3 calls to RelationshipPluginBase::buildOptionsForm()
GroupwiseMax::buildOptionsForm in lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php
Extends the relationship's basic options, allowing the user to pick a sort and an order for it.
NodeTermData::buildOptionsForm in lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php
Default options form that provides the label widget that all fields should have.
Translation::buildOptionsForm in lib/Views/translation/Plugin/views/relationship/Translation.php
Add a translation selector.
4 methods override RelationshipPluginBase::buildOptionsForm()
Broken::buildOptionsForm in lib/Drupal/views/Plugin/views/relationship/Broken.php
Default options form that provides the label widget that all fields should have.
GroupwiseMax::buildOptionsForm in lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php
Extends the relationship's basic options, allowing the user to pick a sort and an order for it.
NodeTermData::buildOptionsForm in lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php
Default options form that provides the label widget that all fields should have.
Translation::buildOptionsForm in lib/Views/translation/Plugin/views/relationship/Translation.php
Add a translation selector.

File

lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php, line 96
Definition of Drupal\views\Plugin\views\relationship\RelationshipPluginBase.

Class

RelationshipPluginBase
Simple relationship handler that allows a new version of the primary table to be linked in.

Namespace

Drupal\views\Plugin\views\relationship

Code

public function buildOptionsForm(&$form, &$form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['label'] = array(
    '#type' => 'textfield',
    '#title' => t('Identifier'),
    '#default_value' => isset($this->options['label']) ? $this->options['label'] : '',
    '#description' => t('Edit the administrative label displayed when referencing this relationship from filters, etc.'),
    '#required' => TRUE,
  );
  $form['required'] = array(
    '#type' => 'checkbox',
    '#title' => t('Require this relationship'),
    '#description' => t('Enable to hide items that do not contain this relationship'),
    '#default_value' => !empty($this->options['required']),
  );
}