You are here

public function UpdateReady::buildForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/update/src/Form/UpdateReady.php \Drupal\update\Form\UpdateReady::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

core/modules/update/src/Form/UpdateReady.php, line 93
Contains \Drupal\update\Form\UpdateReady.

Class

UpdateReady
Configure update settings for this site.

Namespace

Drupal\update\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $this->moduleHandler
    ->loadInclude('update', 'inc', 'update.manager');
  if (!_update_manager_check_backends($form, 'update')) {
    return $form;
  }
  $form['backup'] = array(
    '#prefix' => '<strong>',
    '#markup' => $this
      ->t('Back up your database and site before you continue. <a href=":backup_url">Learn how</a>.', array(
      ':backup_url' => 'https://www.drupal.org/node/22281',
    )),
    '#suffix' => '</strong>',
  );
  $form['maintenance_mode'] = array(
    '#title' => $this
      ->t('Perform updates with site in maintenance mode (strongly recommended)'),
    '#type' => 'checkbox',
    '#default_value' => TRUE,
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => $this
      ->t('Continue'),
  );
  return $form;
}