You are here

function _parse_authors in Bibliography Module 6

This parses the old (pre 6.x) format author entry, splits in on the semicolons and adds new elements to the biblio_contributors array

Parameters

$biblio_contributors an array passed in by reference:

$authors The old author string:

$type The type of author (Primary, Secondary, Tertiary, Corporate):

Return value

none ($biblio_contributors is passed in by reference)

1 call to _parse_authors()
_move_authors in ./biblio.install

File

./biblio.install, line 1474
Install file for biblio module

Code

function _parse_authors(&$biblio_contributors, $authors, $cat = 1) {
  $authors = str_ireplace(" and ", "; ", $authors);
  $authors = str_ireplace(" & ", "; ", $authors);
  $author_array = explode(';', $authors);
  $rank = 0;
  foreach ($author_array as $author) {

    // insert spaces after firstname initials if neccessary
    $author = preg_replace("/\\.([^\\s-])/", ". \\1", trim($author));
    $biblio_contributors[$cat][] = array(
      'name' => $author,
      'auth_type' => $cat,
      'rank' => $rank++,
    );
  }
}