You are here

function _reset_endnote_xml_map in Bibliography Module 6.2

Same name and namespace in other branches
  1. 7 modules/endnote/biblio_xml.install \_reset_endnote_xml_map()
  2. 7.2 modules/endnote/biblio_xml.install \_reset_endnote_xml_map()
2 calls to _reset_endnote_xml_map()
biblio_xml_endnote7_map_reset in modules/endnote/biblio_xml.module
biblio_xml_endnote8_map_reset in modules/endnote/biblio_xml.module

File

modules/endnote/biblio_xml.install, line 81
Database table creation for biblio_xml module.

Code

function _reset_endnote_xml_map($version, $type) {
  $count = db_result(db_query("SELECT COUNT(*) FROM {biblio_type_maps} WHERE format='%s'", $version));
  if ($count && $type) {

    //update
    $function = '_get_' . $version . '_' . $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='%s'", $version);
    $save_maps = '_save_' . $version . '_maps';
    $save_maps();
  }
}