You are here

public function SystemStatusSettingsForm::buildForm in System Status 8.2

Same name and namespace in other branches
  1. 8 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 23

Class

SystemStatusSettingsForm
Configure pants settings for this site.

Namespace

Drupal\system_status\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('system_status.settings');
  $form['system_status_service'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Your siteUUID'),
    '#description' => $config
      ->get('system_status_token') . "-" . $config
      ->get('system_status_encrypt_token'),
    '#default_value' => $config
      ->get('system_status_token') . "-" . $config
      ->get('system_status_encrypt_token'),
    '#attributes' => [
      'style' => [
        'display:none;',
      ],
    ],
    '#size' => 60,
    '#maxlength' => 60,
    '#disabled' => TRUE,
  ];
  $form['system_status_service_allow_external'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Allow external services to fetch this site'),
    '#description' => $this
      ->t('Allow reports to be generated by external services. <br>All information will be sent using encryption and is only accessible using your siteUUID.'),
    '#default_value' => TRUE,
    '#disabled' => TRUE,
    '#default_value' => $config
      ->get('system_status_service_allow_external'),
  ];
  return parent::buildForm($form, $form_state);
}