function _reset_csl_map in Bibliography Module 7.2
Same name and namespace in other branches
- 6.2 modules/CiteProc/biblio_citeproc.install \_reset_csl_map()
- 7 modules/CiteProc/biblio_citeproc.install \_reset_csl_map()
2 calls to _reset_csl_map()
- biblio_citeproc_csl_map_reset in modules/
CiteProc/ biblio_citeproc.module - biblio_citeproc_update_7001 in modules/
CiteProc/ biblio_citeproc.install - Adds CSL field and type maps to biblio_type_maps table
File
- modules/
CiteProc/ biblio_citeproc.install, line 269
Code
function _reset_csl_map($type = NULL) {
$count = db_query("SELECT COUNT(*) FROM {biblio_type_maps} WHERE format='csl'")
->fetchField();
if ($count && $type) {
//update
$function = '_get_csl_' . $type;
if (!function_exists($function)) {
return;
}
$map = $function();
db_update('biblio_type_maps')
->fields($map)
->condition('format', 'csl')
->execute();
}
else {
// install
db_delete('biblio_type_maps')
->condition('format', 'csl')
->execute();
_save_csl_maps();
}
}