You are here

function biblio_format_authors in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 includes/biblio_theme.inc \biblio_format_authors()
  2. 7.2 includes/biblio.theme.inc \biblio_format_authors()
1 call to biblio_format_authors()
theme_biblio_tabular in includes/biblio_theme.inc

File

includes/biblio_theme.inc, line 462

Code

function biblio_format_authors($authors) {
  if (module_exists('biblio_citeproc')) {
    static $auth_proc;
    if (!isset($auth_proc)) {
      module_load_include('inc', 'biblio_citeproc', 'CSL');
      $csl = '<name form="long" name-as-sort-order="all" sort-separator=", " initialize-with="" delimiter=", " />';
      $csl_doc = new DOMDocument();
      $csl_doc
        ->loadXML($csl);
      $auth_proc = new csl_rendering_element($csl_doc);
    }
    $data = $auth_proc
      ->render($authors);
  }
  else {
    $style_name = biblio_get_style();
    $style_function = "biblio_style_{$style_name}" . "_author_options";
    if (!function_exists($style_function)) {
      module_load_include('inc', 'biblio', "/styles/biblio_style_{$style_name}");
    }
    $author_options = $style_function();

    // Set really high so we see all authors.
    $author_options['numberOfAuthorsTriggeringEtAl'] = 100;
    $data = theme('biblio_format_authors', array(
      'contributors' => $authors,
      'options' => $author_options,
    ));
  }
  return $data;
}