Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/install/ucb_site_configuration.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ site_search_enabled:
site_search_label: ''
site_search_url: ''
gtm_account: ''
tos_acceptance_enabled: false

# Settings in "Content types"
article_date_format: '0'
Expand Down
7 changes: 7 additions & 0 deletions src/Form/GeneralForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,12 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#default_value' => $settings->get('gtm_account'),
'#description' => $this->t('Google Tag Manager account number e.g. GTM-123456.'),
];
$advanced['tos_acceptance_enabled'] = [
'#type' => 'checkbox',
'#title' => $this->t('Enable Terms of Service acceptance'),
'#default_value' => $settings->get('tos_acceptance_enabled'),
'#description' => $this->t('When enabled, users will be required to accept the Terms of Service before using the site. The modal will appear on user pages for users who have not yet accepted.'),
];
$form['advanced'] = $advanced;
}
return parent::buildForm($form, $form_state);
Expand Down Expand Up @@ -358,6 +364,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
->set('site_search_placeholder', $siteSearchFormValues['site_search_placeholder'])
->set('site_search_url', $siteSearchFormValues['site_search_url'])
->set('gtm_account', $form_state->getValue('gtm_account'))
->set('tos_acceptance_enabled', $form_state->getValue('tos_acceptance_enabled'))
->save();
}
parent::submitForm($form, $form_state);
Expand Down