function _reset_crossref_map in Bibliography Module 7
Same name and namespace in other branches
- 6.2 modules/crossref/biblio_crossref.install \_reset_crossref_map()
- 7.2 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 57 - 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();
// Update.
if ($count && $type) {
$function = '_get_crossref_' . $type;
if (!function_exists($function)) {
return;
}
$map = $function();
db_update('biblio_type_maps')
->fields($map)
->condition('format', 'crossref')
->execute();
}
else {
// db_query("DELETE FROM {biblio_type_maps} WHERE format='crossref'");.
db_delete('biblio_type_maps')
->condition('format', 'crossref')
->execute();
_save_crossref_maps();
}
}