You are here

function _biblio_format_author_page in Bibliography Module 6.2

Same name and namespace in other branches
  1. 6 biblio.pages.inc \_biblio_format_author_page()
  2. 7 includes/biblio.pages.inc \_biblio_format_author_page()
  3. 7.2 includes/biblio.pages.inc \_biblio_format_author_page()

Parameters

array $filter:

array $authors:

1 call to _biblio_format_author_page()
biblio_author_page in includes/biblio.pages.inc

File

includes/biblio.pages.inc, line 1369
Functions in the biblio module related to filtering and page generation.

Code

function _biblio_format_author_page($filter, $authors) {
  $header_ext = $checkbox = '';
  $header = array();
  if (biblio_access('edit_author')) {
    if (!empty($filter)) {
      $header_ext = ' ' . t('whose last name begins with the letter') . ': ' . $filter;
    }
    $checkbox = array(
      '#title' => t('Hightlight possible duplicates'),
      '#name' => 'duplicate_authors',
      '#value' => 0,
      '#type' => 'checkbox',
      '#id' => 'biblio-highlight',
      '#parents' => array(
        '',
      ),
    );
    $checkbox = '<div class="biblio-alpha-line">' . drupal_render($checkbox) . '</div>';
    $header = array(
      array(
        'data' => t('There are a total of @count authors in the database!header_ext.', array(
          '@count' => count($authors),
          '!header_ext' => $header_ext,
        )),
        'align' => 'center',
        'colspan' => 3,
      ),
    );
  }
  $rows[] = array(
    array(
      'data' => theme('biblio_alpha_line', 'authors', $filter) . $checkbox,
      'colspan' => 3,
    ),
  );
  if (count($authors)) {
    for ($i = 0; $i < count($authors); $i += 3) {
      $rows[] = array(
        array(
          'data' => _biblio_format_author($authors[$i]),
        ),
        array(
          'data' => isset($authors[$i + 1]) ? _biblio_format_author($authors[$i + 1]) : '',
        ),
        array(
          'data' => isset($authors[$i + 2]) ? _biblio_format_author($authors[$i + 2]) : '',
        ),
      );
    }
  }

  //$header = array(array('data' => t('There are a total of @count authors !header_ext in the database',array('@count' => count($authors), '!header_ext' => $header_ext)), 'align' =>'center', 'colspan' => 3));
  $output = theme('table', $header, $rows);
  return $output;
}