You are here

function theme_biblio_admin_field_mapper_form in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 includes/biblio.admin.inc \theme_biblio_admin_field_mapper_form()
  2. 7 includes/biblio.admin.inc \theme_biblio_admin_field_mapper_form()
  3. 7.2 includes/biblio.admin.inc \theme_biblio_admin_field_mapper_form()

File

./biblio.admin.inc, line 1131

Code

function theme_biblio_admin_field_mapper_form($form) {
  switch ($form['fileformat']['#value']) {
    case 'bibtex':
      $title = 'BibTex';
      break;
    case 'ris':
      $title = 'RIS';
      break;
    case 'tagged':
      $title = 'EndNote Tagged';
      break;
    case 'endnote7':
      $title = 'EndNote 7 and earlier XML';
      break;
    case 'endnote8':
      $title = 'EndNote 8 and later XML';
      break;
  }
  if ($form['submit']['#value'] == t('Save')) {
    drupal_set_title($title . ' ' . t('Field Mapping'));
    foreach (element_children($form['type']) as $key) {
      $rows[] = array(
        drupal_render($form['type'][$key]['format']),
        drupal_render($form['type'][$key]['biblio']),
        drupal_render($form['type'][$key]),
      );
    }
    $header = array(
      $title . ' ' . t('field identifier'),
      t('Biblio schema field'),
      t('Export'),
    );
    $output .= theme('table', $header, $rows);

    //$output .= l('['.t('Add New'). " $title ".t('Publication Type').']','admin/settings/biblio/fields/typemap/'.$form['fileformat']['#value'].'/add').' ';

    //$output .= l('['.t('Add New Biblio Publication Type').']','admin/settings/biblio/fields/type/new').'<br />';
  }
  elseif ($form['submit']['#value'] == t('Add')) {
    drupal_set_title(t('Add new publication type to ') . $title . ' ' . t('file type'));
    $output .= drupal_render($form['type_name']);
    $output .= drupal_render($form['type_desc']);
  }
  $output .= drupal_render($form['submit']);
  $output .= drupal_render($form['reset']);
  $output .= drupal_render($form);
  return $output;
}