You are here

public function UnblockReplicationForm::buildForm in Workspace 8

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/UnblockReplicationForm.php, line 51

Class

UnblockReplicationForm
Class UnblockReplicationForm.

Namespace

Drupal\workspace\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $last_replication_failed = $this->state
    ->get('workspace.last_replication_failed', FALSE);
  $form['unblock'] = array(
    '#type' => 'fieldset',
    '#title' => $this
      ->t('Unblock replication'),
  );
  $form['unblock']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Unblock replication'),
    '#disabled' => !$last_replication_failed,
  ];
  $form['unblock']['description'] = [
    '#type' => 'markup',
    '#markup' => '<div class="description">' . $this
      ->t('Replications will be blocked after any kind of failure. This action will unblock replications so that they can run again (but make sure to resolve the underlying issue first).') . '</div>',
  ];
  return $form;
}