function _reset_ris_map in Bibliography Module 7
Same name and namespace in other branches
- 6.2 modules/RIS/biblio_ris.install \_reset_ris_map()
- 7.2 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 59 - 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();
// Update.
if ($count && $type) {
$function = '_get_ris_' . $type;
if (!function_exists($function)) {
return;
}
$map = $function();
db_update('biblio_type_maps')
->fields($map)
->condition('format', 'ris')
->execute();
}
else {
db_delete('biblio_type_maps')
->condition('format', 'ris')
->execute();
_save_ris_maps();
}
}