You are here

public function Links::buildOptionsForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/field/Links.php \Drupal\views\Plugin\views\field\Links::buildOptionsForm()

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

Overrides FieldPluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/field/Links.php, line 43
Contains \Drupal\views\Plugin\views\field\Links.

Class

Links
A abstract handler which provides a collection of links.

Namespace

Drupal\views\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);

  // Only show fields that precede this one.
  $field_options = $this
    ->getPreviousFieldLabels();
  $form['fields'] = array(
    '#type' => 'checkboxes',
    '#title' => $this
      ->t('Fields'),
    '#description' => $this
      ->t('Fields to be included as links.'),
    '#options' => $field_options,
    '#default_value' => $this->options['fields'],
  );
  $form['destination'] = array(
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Include destination'),
    '#description' => $this
      ->t('Include a "destination" parameter in the link to return the user to the original view upon completing the link action.'),
    '#default_value' => $this->options['destination'],
  );
}