You are here

function legal_configuration_submit in Legal 7

Same name and namespace in other branches
  1. 7.2 legal.admin.inc \legal_configuration_submit()

File

./legal.admin.inc, line 61
Administration UI for the Legal module.

Code

function legal_configuration_submit($form, &$form_state) {
  $values = $form_state['values'];
  variable_set('legal_user_profile_display', $values['user_profile_display']);
  variable_set('legal_accept_every_login', $values['legal_accept_every_login']);

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