You are here

public function CourierMaintenanceForm::buildForm in Courier 8

Same name and namespace in other branches
  1. 2.x src/Form/CourierMaintenanceForm.php \Drupal\courier\Form\CourierMaintenanceForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

File

src/Form/CourierMaintenanceForm.php, line 56
Contains \Drupal\courier\Form\CourierMaintenanceForm.

Class

CourierMaintenanceForm
Courier maintenance form.

Namespace

Drupal\courier\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['mqi'] = [
    '#type' => 'details',
    '#open' => TRUE,
  ];
  $form['mqi']['delete_age'] = [
    '#title' => $this
      ->t('Delete old messages'),
    '#description' => $this
      ->t('This is used to delete messages queue items that have gotten stuck in the queue.'),
    '#type' => 'number',
    '#field_prefix' => $this
      ->t('Delete message older than'),
    '#field_suffix' => $this
      ->t('seconds'),
    '#min' => 1,
    '#default_value' => 60 * 60 * 24,
  ];
  $form['mqi']['actions'] = [
    '#type' => 'actions',
  ];
  $form['mqi']['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Delete messages'),
    '#button_type' => 'danger',
  ];
  return $form;
}