function _parse_author_array in Bibliography Module 5
3 calls to _parse_author_array()
- author_test in ./biblio.module
- biblio_contextObject in ./biblio.module
- _endnote_tagged_export in ./biblio.module
File
- ./biblio.module, line 3292
Code
function _parse_author_array($authorArray) {
$count = 1;
foreach ($authorArray as $value) {
$appellation = $prefix = $surname = $firstname = $initials = '';
$author = explode(",", preg_replace("/\\s{2,}/", ' ', trim($value)));
$size = sizeof($author);
if ($size == 1) {
$author = split(" ", $value);
$surname = array_pop($author);
}
else {
if ($size == 2) {
list($surname, $prefix) = _grabSurname(array_shift($author));
}
else {
$appellation = array_pop($author);
list($surname, $prefix) = _grabSurname(array_shift($author));
}
}
$remainder = join(" ", $author);
list($firstname, $initials) = _grabFirstnameInitials($remainder);
$surname = $surname . ' ' . $appellation;
$creators[] = array(
'first_name' => trim("{$firstname}"),
'initials' => trim("{$initials}"),
'last_name' => trim("{$surname}"),
'prefix' => trim("{$prefix}"),
'order' => "{$count}",
);
$count++;
}
if (isset($creators)) {
return $creators;
}
return FALSE;
}