degov-8.x-2.0/modules/degov_paragraph_webform/degov_paragraph_webform.module
modules/degov_paragraph_webform/degov_paragraph_webform.module
<?php
use Drupal\degov_common\Common;
/**
* Implements hook_preprocess().
*/
function degov_paragraph_webform_preprocess(&$variables, $hook, &$info) {
// Add template suggestions and libraries implemented in this module.
Common::addThemeSuggestions($variables, $hook, $info, [
'module_name' => 'degov_paragraph_webform',
'entity_type' => 'paragraph',
'entity_bundles' => ['webform'],
'entity_view_modes' => ['preview'],
]);
}
/**
* Implements hook_form_alter().
*
* @param $form
* @param \Drupal\Core\Form\FormState $form_state
* @param $form_id
*/
function degov_paragraph_webform_form_alter(&$form, \Drupal\Core\Form\FormState &$form_state, $form_id) {
if (strpos($form_id, 'webform_submission_') !== FALSE) {
$form['actions']['reset'] = [
'#markup' => '<div class="reset-form">'.
'<a role="button" tabindex="0"><span class="reset">' . t('Zurücksetzen'). '<i class="fa fa-times" aria-hidden="true"></i></span></a>'.
'</div>',
'#weight' => -100,
];
}
}
