public function WebformSignature::buildExportOptionsForm in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/WebformElement/WebformSignature.php \Drupal\webform\Plugin\WebformElement\WebformSignature::buildExportOptionsForm()
Get an element's export options webform.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
array $export_options: An associative array of default values.
Return value
array An associative array contain an element's export option webform.
Overrides WebformElementBase::buildExportOptionsForm
File
- src/
Plugin/ WebformElement/ WebformSignature.php, line 153
Class
- WebformSignature
- Provides a 'signature' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function buildExportOptionsForm(array &$form, FormStateInterface $form_state, array $export_options) {
parent::buildExportOptionsForm($form, $form_state, $export_options);
if (isset($form['signature'])) {
return;
}
$form['signature'] = [
'#type' => 'details',
'#title' => $this
->t('Signature options'),
'#open' => TRUE,
];
$form['signature']['signature_format'] = [
'#type' => 'radios',
'#title' => $this
->t('Signature format'),
'#options' => [
'image' => $this
->t('Image, the signature\'s <a href=":href">Data URI</a>.', [
':href' => 'https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs',
]),
'status' => $this
->t("Status, displays 'signed' or 'no signed'"),
],
'#default_value' => $export_options['signature_format'],
];
}