public function EditTexts::submitForm in TacJS 8.4
Same name and namespace in other branches
- 8.6 src/Form/Steps/EditTexts.php \Drupal\tacjs\Form\Steps\EditTexts::submitForm()
- 8.2 src/Form/Steps/EditTexts.php \Drupal\tacjs\Form\Steps\EditTexts::submitForm()
- 8.3 src/Form/Steps/EditTexts.php \Drupal\tacjs\Form\Steps\EditTexts::submitForm()
- 8.5 src/Form/Steps/EditTexts.php \Drupal\tacjs\Form\Steps\EditTexts::submitForm()
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides ConfigFormBase::submitForm
File
- src/
Form/ Steps/ EditTexts.php, line 392
Class
- EditTexts
- Class EditTexts.
Namespace
Drupal\tacjs\Form\StepsCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('tacjs.settings');
$elements = [
'middleBarHead',
'adblock',
'adblock_call',
'reload',
'alertBigScroll',
'alertBigClick',
'alertBig',
'alertBigPrivacy',
'alertSmall',
'personalize',
'acceptAll',
'close',
'privacyUrl',
'all',
'info',
'disclaimer',
'allow',
'deny',
'noCookie',
'useCookie',
'useCookieCurrent',
'useNoCookie',
'more',
'source',
'credit',
'noServices',
'toggleInfoBox',
'title',
'cookieDetail',
'ourSite',
'newWindow',
'allowAll',
'denyAll',
'fallback',
'ads_title',
'ads_details',
'analytic_title',
'analytic_details',
'social_title',
'social_details',
'video_title',
'video_details',
'comment_title',
'comment_details',
'support_title',
'support_details',
'api_title',
'api_details',
'other_title',
'other_details',
];
foreach ($elements as $key) {
if ($form_state
->getValue($key)) {
$config
->set('texts.' . $key, $form_state
->getValue($key));
}
}
$config
->save();
parent::submitForm($form, $form_state);
}