public function WebformEntitySettingsSubmissionsForm::buildForm in Webform 8.5
Same name and namespace in other branches
- 6.x src/EntitySettings/WebformEntitySettingsSubmissionsForm.php \Drupal\webform\EntitySettings\WebformEntitySettingsSubmissionsForm::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 EntityForm::buildForm
File
- src/
EntitySettings/ WebformEntitySettingsSubmissionsForm.php, line 49
Class
- WebformEntitySettingsSubmissionsForm
- Webform submissions settings.
Namespace
Drupal\webform\EntitySettingsCode
public function buildForm(array $form, FormStateInterface $form_state) {
/** @var \Drupal\webform\WebformInterface $webform */
$webform = $this->entity;
// Display warning and disable the submission form.
if ($webform
->isResultsDisabled()) {
$this
->messenger()
->addWarning($this
->t('Saving of submissions is disabled, submission settings, submission limits, purging and the saving of drafts is disabled. Submissions must be sent via an email or handled using a <a href=":href">custom webform handler</a>.', [
':href' => $webform
->toUrl('handlers')
->toString(),
]));
return $form;
}
return parent::buildForm($form, $form_state);
}