You are here

public function SystemStatusSettingsForm::buildForm in System Status 8

Same name and namespace in other branches
  1. 8.2 src/Form/SystemStatusSettingsForm.php \Drupal\system_status\Form\SystemStatusSettingsForm::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 ConfigFormBase::buildForm

File

src/Form/SystemStatusSettingsForm.php, line 28
Contains \Drupal\pants\Form\PantsSettingsForm.

Class

SystemStatusSettingsForm
Configure pants settings for this site.

Namespace

Drupal\system_status\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this->configFactory
    ->get('system_status.settings');
  $form['system_status_service_allow_drupalstatus'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow reporting to DrupalStatus.org'),
    '#description' => t('Allow reports to be generated by DrupalStatus. The reports will be stored and send using encryption and are only accessible using your account credentials on DrupalStatus.org'),
    '#default_value' => $config
      ->get('system_status_service_allow_drupalstatus'),
  );
  $form['add_site'] = array(
    '#type' => 'submit',
    '#value' => t('Add this site to your DrupalStatus.org overview'),
    '#submit' => array(
      'system_status_add_site',
    ),
  );
  return parent::buildForm($form, $form_state);
}