You are here

function _reset_ris_map in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 modules/RIS/biblio_ris.install \_reset_ris_map()
  2. 7 modules/RIS/biblio_ris.install \_reset_ris_map()
1 call to _reset_ris_map()
biblio_ris_ris_map_reset in modules/RIS/biblio_ris.module

File

modules/RIS/biblio_ris.install, line 42
Database table creation for biblio_ris module.

Code

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

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

    // install
    db_delete('biblio_type_maps')
      ->condition('format', 'ris')
      ->execute();
    _save_ris_maps();
  }
}