public function ModuleConfigureForm::buildForm in Thunder 8.3
Same name and namespace in other branches
- 8.5 src/Installer/Form/ModuleConfigureForm.php \Drupal\thunder\Installer\Form\ModuleConfigureForm::buildForm()
- 8.2 src/Installer/Form/ModuleConfigureForm.php \Drupal\thunder\Installer\Form\ModuleConfigureForm::buildForm()
- 8.4 src/Installer/Form/ModuleConfigureForm.php \Drupal\thunder\Installer\Form\ModuleConfigureForm::buildForm()
- 6.2.x src/Installer/Form/ModuleConfigureForm.php \Drupal\thunder\Installer\Form\ModuleConfigureForm::buildForm()
- 6.0.x src/Installer/Form/ModuleConfigureForm.php \Drupal\thunder\Installer\Form\ModuleConfigureForm::buildForm()
- 6.1.x src/Installer/Form/ModuleConfigureForm.php \Drupal\thunder\Installer\Form\ModuleConfigureForm::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/
Installer/ Form/ ModuleConfigureForm.php, line 66
Class
- ModuleConfigureForm
- Provides the site configuration form.
Namespace
Drupal\thunder\Installer\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
// We have to delete all messages, because simple_sitemap adds a bunch of
// messages during the install process.
// @see https://www.drupal.org/project/simple_sitemap/issues/3001388.
$this
->messenger()
->deleteAll();
$form['description'] = [
'#type' => 'item',
'#markup' => $this
->t('Keep calm. You can install all the modules later, too.'),
];
$form['install_modules'] = [
'#type' => 'container',
];
$providers = $this->optionalModulesManager
->getDefinitions();
static::sortByWeights($providers);
foreach ($providers as $provider) {
$instance = $this->optionalModulesManager
->createInstance($provider['id']);
$form['install_modules_' . $provider['id']] = [
'#type' => 'checkbox',
'#title' => $provider['label'],
'#description' => isset($provider['description']) ? $provider['description'] : '',
'#default_value' => isset($provider['standardlyEnabled']) ? $provider['standardlyEnabled'] : 0,
];
$form = $instance
->buildForm($form, $form_state);
}
$form['#title'] = $this
->t('Install & configure modules');
$form['actions'] = [
'#type' => 'actions',
];
$form['actions']['save'] = [
'#type' => 'submit',
'#value' => $this
->t('Save and continue'),
'#button_type' => 'primary',
'#submit' => [
'::submitForm',
],
];
return $form;
}