function _md5sum in Bibliography Module 7.2
Same name and namespace in other branches
- 6 biblio.contributors.inc \_md5sum()
- 7 includes/biblio.contributors.inc \_md5sum()
Parameters
$creator:
Return value
unknown_type
2 calls to _md5sum()
- biblio_contributor_create in ./
biblio.module - Create a contributor entity object
- biblio_contributor_pre_save in includes/
biblio.contributors.inc - Perform actions to a contributor object before saving
File
- includes/
biblio.contributors.inc, line 368
Code
function _md5sum($contributor) {
$wrapper = biblio_wrapper($contributor, 'biblio_contributor');
switch ($contributor->type) {
case 'organization':
$string = $wrapper->biblio_contributor_name
->value();
break;
default:
$string = $wrapper->biblio_contributor_first_name
->value() . $wrapper->biblio_contributor_mid_init
->value() . $wrapper->biblio_contributor_prefix
->value() . $wrapper->biblio_contributor_last_name
->value() . $wrapper->biblio_contributor_affiliation
->value();
if (empty($string)) {
// fallback if no other fields have data
$string = $wrapper->biblio_contributor_name
->value();
}
break;
}
$string = str_replace(' ', '', drupal_strtolower($string));
return md5($string);
}