You are here

public function FieldEntry::buildConfigurationForm in Flag 8.4

Provides a form array for the action link plugin's settings form.

Derived classes will want to override this method.

Parameters

array $form: The form array.

FormStateInterface $form_state: The form state.

Return value

array The modified form array.

Overrides FormEntryTypeBase::buildConfigurationForm

File

src/Plugin/ActionLink/FieldEntry.php, line 57

Class

FieldEntry
Class FieldEntry

Namespace

Drupal\flag\Plugin\ActionLink

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildConfigurationForm($form, $form_state);
  $form['display']['settings']['link_options_' . $this
    ->getPluginId()]['edit_flagging'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Edit flagging details message'),
    '#default_value' => $this->configuration['edit_flagging'],
    '#description' => $this
      ->t('Message displayed if the user has clicked the "Edit flag" link. Usually presented in the form such as, "Please enter the flagging details."'),
    // This will get changed to a state by flag_link_type_options_states().
    '#required' => TRUE,
  ];
  $form['display']['settings']['link_options_field_entry']['flag_update_button'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Update flagging button text'),
    '#default_value' => $this->configuration['flag_update_button'],
    '#description' => $this
      ->t('The text for the submit button when updating a flagging.'),
    // This will get changed to a state by flag_link_type_options_states().
    '#required' => TRUE,
  ];
  return $form;
}