You are here

function theme_biblio_admin_orphans_form in Bibliography Module 6.2

Same name and namespace in other branches
  1. 6 biblio_theme.inc \theme_biblio_admin_orphans_form()

File

includes/biblio_theme.inc, line 1297

Code

function theme_biblio_admin_orphans_form($form) {

  // If there are any orphans, then $form['name'] contains a list of the author names
  $has_items = isset($form['name']) && is_array($form['name']);
  $select_header = $has_items ? theme('table_select_header_cell') : '';
  $header = array(
    $select_header,
    t('Author Name'),
    t('Affiliation'),
  );
  $output = '';
  $output .= drupal_render($form['submit']);
  if ($has_items) {
    foreach (element_children($form['name']) as $key) {
      $row = array();
      $row[] = drupal_render($form['authors'][$key]);
      $row[] = drupal_render($form['name'][$key]);
      $row[] = drupal_render($form['affiliation'][$key]);
      $rows[] = $row;
    }
  }
  else {
    $rows[] = array(
      array(
        'data' => t('There are no orphaned authors in the database.'),
        'colspan' => '3',
      ),
    );
  }
  $output .= theme('table', $header, $rows);
  if ($form['pager']['#value']) {
    $output .= drupal_render($form['pager']);
  }
  $output .= drupal_render($form);
  return $output;
}