You are here

public function BiblioStyleEndNoteXML8::importContributor in Bibliography Module 7.3

Import a Contributor.

Parameters

EntityMetadataWrapper $wrapper: The wrapped Biblio object.

$role: The role of the contributor.

$name: The name of the contributor.

File

plugins/biblio_style/endnote/BiblioStyleEndNoteXML8.php, line 227
EndNote XML8 biblio style.

Class

BiblioStyleEndNoteXML8
@file EndNote XML8 biblio style.

Code

public function importContributor(EntityMetadataWrapper $wrapper, $role, $name) {
  $biblio = $wrapper
    ->value();

  // Map the role to Biblio.
  $role = $role == 'authors' ? 'author' : str_replace('-authors', '', $role);

  // @todo: Check if roles make sense.
  switch ($role) {
    case 'authors':
      $role = 'Author';
      break;
    case 'secondary-authors':
      $role = 'Secondary Author';
      break;
    case 'tertiary-authors':
      $role = 'Tertiary Author';
      break;
    case 'subsidiary-authors':
      $role = 'Subsidiary Author';
      break;
    case 'translated-authors':
      $role = 'Translator';
  }
  $this
    ->addContributors($name, $role);
}