You are here

function _reset_crossref_map in Bibliography Module 6.2

Same name and namespace in other branches
  1. 7 modules/crossref/biblio_crossref.install \_reset_crossref_map()
  2. 7.2 modules/crossref/biblio_crossref.install \_reset_crossref_map()
1 call to _reset_crossref_map()
biblio_crossref_crossref_map_reset in modules/crossref/biblio_crossref.module

File

modules/crossref/biblio_crossref.install, line 63
Database table creation for biblio_crossref module.

Code

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

    //update
    $function = '_get_crossref_' . $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='crossref'");
    _save_crossref_maps();
  }
}