You are here

function _reset_csl_map in Bibliography Module 6.2

Same name and namespace in other branches
  1. 7 modules/CiteProc/biblio_citeproc.install \_reset_csl_map()
  2. 7.2 modules/CiteProc/biblio_citeproc.install \_reset_csl_map()
1 call to _reset_csl_map()
biblio_citeproc_update_6002 in modules/CiteProc/biblio_citeproc.install

File

modules/CiteProc/biblio_citeproc.install, line 294

Code

function _reset_csl_map($type = NULL) {
  $count = db_result(db_query("SELECT COUNT(*) FROM {biblio_type_maps} WHERE format='csl'"));
  if ($count && $type) {

    //update
    $function = '_get_csl_' . $type;
    if (!function_exists($function)) {
      return;
    }
    $map = $function();
    drupal_write_record('biblio_type_maps', $map, 'format');
  }
  else {

    // install
    db_query("DELETE FROM {biblio_type_maps} WHERE format='csl'");
    _save_csl_maps();
  }
}