You are here

function _reset_tagged_map in Bibliography Module 6.2

Same name and namespace in other branches
  1. 7 modules/endnote/biblio_tagged.install \_reset_tagged_map()
  2. 7.2 modules/endnote/biblio_tagged.install \_reset_tagged_map()
1 call to _reset_tagged_map()
biblio_tagged_tagged_map_reset in modules/endnote/biblio_tagged.module

File

modules/endnote/biblio_tagged.install, line 184
Database table creation for biblio_tagged module.

Code

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

    //update
    $function = '_get_tagged_' . $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='tagged'");
    _save_tagged_maps();
  }
}