You are here

public function FormStep::settingsForm in Simple multi step form 8

Same name and namespace in other branches
  1. 8.x src/Plugin/field_group/FieldGroupFormatter/FormStep.php \Drupal\simple_multistep\Plugin\field_group\FieldGroupFormatter\FormStep::settingsForm()

File

src/Plugin/field_group/FieldGroupFormatter/FormStep.php, line 57

Class

FormStep
Plugin implementation of the 'form_step' formatter.

Namespace

Drupal\simple_multistep\Plugin\field_group\FieldGroupFormatter

Code

public function settingsForm() {
  $form = parent::settingsForm();
  $form['label']['#title'] = $this
    ->t('Step title');
  $form['show_step_title'] = [
    '#title' => $this
      ->t('Show step title'),
    '#type' => 'checkbox',
    '#default_value' => $this
      ->getSetting('show_step_title'),
    '#description' => $this
      ->t('Show step title'),
    '#weight' => 1,
  ];
  $form['back_button_show'] = [
    '#title' => $this
      ->t('Show back button'),
    '#type' => 'checkbox',
    '#default_value' => $this
      ->getSetting('back_button_show'),
    '#description' => $this
      ->t('Back button for form. Don`t show on first step'),
    '#weight' => 2,
  ];
  $form['back_button_text'] = [
    '#title' => $this
      ->t('Text for back button'),
    '#type' => 'textfield',
    '#default_value' => $this
      ->getSetting('back_button_text'),
    '#description' => $this
      ->t('Text which will be show on back button'),
    '#weight' => $form['back_button_show']['#weight'] + 0.1,
  ];
  $form['next_button_text'] = [
    '#title' => $this
      ->t('Text for next button'),
    '#type' => 'textfield',
    '#default_value' => $this
      ->getSetting('next_button_text'),
    '#description' => $this
      ->t('Text which will be show on next button'),
  ];
  return $form;
}