You are here

function biblio_admin_keyword_edit_form_submit in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 includes/biblio.admin.inc \biblio_admin_keyword_edit_form_submit()
  2. 7 includes/biblio.admin.inc \biblio_admin_keyword_edit_form_submit()
  3. 7.2 includes/biblio.admin.inc \biblio_admin_keyword_edit_form_submit()

File

./biblio.admin.inc, line 2037

Code

function biblio_admin_keyword_edit_form_submit($form, &$form_state) {
  if ($form_state['values']['op'] == t('Save')) {
    drupal_write_record('biblio_keyword_data', $form_state['values'], 'kid');
    if (count($form_state['values']['merge_keywords'])) {
      $kids = implode(',', $form_state['values']['merge_keywords']);
      update_sql("UPDATE {biblio_keyword} SET kid={$form_state['values']['kid']} WHERE kid IN ({$kids})");
      update_sql("DELETE FROM {biblio_keyword_data} WHERE kid IN ({$kids})");
    }
  }
}