UpdateReady::buildForm

public UpdateReady::buildForm(array $form, FormStateInterface $form_state)

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 88

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;
}
doc_Drupal
2016-10-29 09:51:09
Comments
Leave a Comment

Please login to continue.