You are here

public function ViewsSend::buildOptionsForm in Views Send 8

Overrides \Drupal\system\Plugin\views\field\BulkForm::buildOptionsForm().

Overrides BulkForm::buildOptionsForm

File

src/Plugin/views/field/ViewsSend.php, line 30

Class

ViewsSend
Defines a simple send mass mail form element.

Namespace

Drupal\views_send\Plugin\views\field

Code

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

  // Hide options that are irrelevant.
  $form['element_label_colon']['#access'] = FALSE;
  $form['exclude']['#access'] = FALSE;
  $form['alter']['#access'] = FALSE;
  $form['empty_field_behavior']['#access'] = FALSE;

  // Hide the available actions configuration as we haven't defined a bulk action to select from.
  $form['action_title']['#access'] = FALSE;
  $form['include_exclude']['#access'] = FALSE;
  $form['selected_actions']['#access'] = FALSE;
  $form['enable_excluded_fields'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Use excluded fields as tokens'),
    '#default_value' => $this->options['enable_excluded_fields'],
  ];
}