You are here

function _formdefaults_save_form in Form Defaults 6.2

Same name and namespace in other branches
  1. 5.3 formdefaults.admin.inc \_formdefaults_save_form()
  2. 7 formdefaults.admin.inc \_formdefaults_save_form()
3 calls to _formdefaults_save_form()
formdefaults_edit_field_submit in ./formdefaults.admin.inc
formdefaults_edit_form_submit in ./formdefaults.admin.inc
formdefaults_import_submit in ./formdefaults.admin.inc

File

./formdefaults.admin.inc, line 25

Code

function _formdefaults_save_form($formid, $form_array) {
  $old_form = formdefaults_getform($formid);
  $form_data = serialize($form_array);
  if ($form_data) {
    if ($old_form) {
      db_query('UPDATE {formdefaults_forms} SET formdata=\'%s\' WHERE formid=\'%s\'', $form_data, $formid);
    }
    else {
      db_query('INSERT INTO {formdefaults_forms} (formid, formdata) VALUES (\'%s\',\'%s\')', $formid, $form_data);
    }
  }
  else {
    _formdefaults_delete_form($formid);
  }
}