You are here

function legal_administration_submit in Legal 5

Same name and namespace in other branches
  1. 6.8 legal.admin.inc \legal_administration_submit()
  2. 6.7 legal.module \legal_administration_submit()
  3. 7.2 legal.admin.inc \legal_administration_submit()
  4. 7 legal.admin.inc \legal_administration_submit()

File

./legal.module, line 297

Code

function legal_administration_submit($form_id, $form_values) {
  if ($form_values['op'] == t('Preview')) {
    return;
  }
  if (variable_get('legal_display', '0') != $form_values['display']) {
    variable_set('legal_display', $form_values['display']);
    drupal_set_message(t('Display setting has been saved.'));
  }

  // If new conditions are different from current permisions - enter in database
  if (legal_conditions_updated($form_values)) {
    db_query("INSERT INTO {legal_conditions} (tc_id, conditions, date, extras, changes) VALUES (NULL, '%s', %d, '%s', '%s')", $form_values['conditions'], time(), serialize($form_values['extras']), $form_values['changes']);
    drupal_set_message(t('Terms & Conditions have been saved.'));
  }
  cache_clear_all();
  return;
}