You are here

function pay_admin_settings_submit in Pay 6

Same name and namespace in other branches
  1. 7 includes/pay.admin.inc \pay_admin_settings_submit()

Submit handler for settings form.

1 string reference to 'pay_admin_settings_submit'
pay_admin_settings in includes/pay.admin.inc
Overall settings form for global payment options.

File

includes/pay.admin.inc, line 72
Administration form settings and related functions.

Code

function pay_admin_settings_submit($form, &$form_state) {

  // No variable has been set yet, so this is the first time setting this value.
  // Set this default value on all pay_forms and pay_transactions.
  $currency = $form_state['values']['pay_currency'];
  if (!($count = db_result(db_query("SELECT count(1)\n    FROM {pay_transaction}\n    WHERE currency IS NOT NULL AND currency NOT IN ('', '%s')", $currency)))) {
    db_query("UPDATE {pay_form} SET currency = '%s'", $currency);
    db_query("UPDATE {pay_transaction} SET currency = '%s'", $currency);
  }
}