You are here

function _reset_crossref_map in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 modules/crossref/biblio_crossref.install \_reset_crossref_map()
  2. 7 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 39
Database table creation for biblio_crossref module.

Code

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

    //update
    $function = '_get_crossref_' . $type;
    if (!function_exists($function)) {
      return;
    }
    $map = $function();
    db_update('biblio_type_maps')
      ->fields($map)
      ->condition('format', 'crossref')
      ->execute();
  }
  else {

    // install
    //    db_query("DELETE FROM {biblio_type_maps} WHERE format='crossref'");
    db_delete('biblio_type_maps')
      ->condition('format', 'crossref')
      ->execute();
    _save_crossref_maps();
  }
}