You are here

function _reset_tagged_map in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 modules/endnote/biblio_tagged.install \_reset_tagged_map()
  2. 7 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 162
Database table creation for biblio_tagged module.

Code

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

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

    // install
    db_delete('biblio_type_maps')
      ->condition('format', 'tagged')
      ->execute();
    _save_tagged_maps();
  }
}