You are here

public function BackgroundBatchSettingsForm::buildForm in Background Process 8

Implements to Build the Batch Form.

Overrides ConfigFormBase::buildForm

File

background_batch/src/Form/BackgroundBatchSettingsForm.php, line 49

Class

BackgroundBatchSettingsForm
Default controller for the background_batch module.

Namespace

Drupal\background_batch\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = [];
  $form['background_batch_delay'] = [
    '#type' => 'textfield',
    '#default_value' => \Drupal::config('background_batch.settings')
      ->get('background_batch_delay'),
    '#title' => 'Delay',
    '#description' => $this
      ->t('Time in microseconds for progress refresh'),
  ];
  $form['background_batch_process_lifespan'] = [
    '#type' => 'textfield',
    '#default_value' => \Drupal::config('background_batch.settings')
      ->get('background_batch_process_lifespan'),
    '#title' => 'Process lifespan',
    '#description' => $this
      ->t('Time in milliseconds for progress lifespan'),
  ];
  $form['background_batch_show_eta'] = [
    '#type' => 'checkbox',
    '#default_value' => \Drupal::config('background_batch.settings')
      ->get('background_batch_show_eta'),
    '#title' => 'Show ETA of batch process',
    '#description' => $this
      ->t('Whether ETA (estimated time of arrival) information should be shown'),
  ];
  return parent::buildForm($form, $form_state);
}