You are here

function gdpr_consent_configuration_submit in GDPR Consent 7

Implements hook_form_id_submit().

File

./gdpr_consent.admin.inc, line 89
Administration UI for the GDPR Consent module.

Code

function gdpr_consent_configuration_submit($form, &$form_state) {
  $values = $form_state['values'];
  variable_set('gdpr_consent_accept_every_login', $values['gdpr_consent_accept_every_login']);
  variable_set('gdpr_consent_disallow_without', $values['gdpr_consent_disallow_without']);
  variable_set('gdpr_consent_nag_message', $values['gdpr_consent_nag_message']);
  variable_set('gdpr_consent_block_admin', $values['gdpr_consent_block_admin']);

  // Set the excepted user roles.
  if (!empty($values['except_roles'])) {
    $except_roles = array_filter($values['except_roles']);
    variable_set('gdpr_consent_except_roles', $except_roles);
  }
  if (variable_get('gdpr_consent_display', '1') != $values['display']) {
    variable_set('gdpr_consent_display', $values['display']);
    drupal_set_message(t('Display setting has been saved.'));
  }
  if (isset($values['link_target']) && $values['link_target'] != variable_get('gdpr_consent_link_target', '')) {
    variable_set('gdpr_consent_link_target', $values['link_target']);
    drupal_set_message(t('Link target setting has been saved.'));
  }
}