You are here

function biblio_get_map in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 biblio.module \biblio_get_map()
  2. 7.2 biblio.module \biblio_get_map()

Parameters

string $type: (can be one of "type_names", "type_map" or "field_map")

string $format: (tagged, ris, endnote_xml8 etc...)

Return value

array $map

21 calls to biblio_get_map()
BiblioImportExportWebTestCase::testBiblioBibtexFileImport in tests/BiblioImportExportWebTestCase.test
BiblioImportExportWebTestCase::testBiblioRISFileImport in tests/BiblioImportExportWebTestCase.test
BiblioImportExportWebTestCase::testBiblioTaggedFileImport in tests/BiblioImportExportWebTestCase.test
BiblioImportExportWebTestCase::testBiblioXMLFileImport in tests/BiblioImportExportWebTestCase.test
biblio_admin_field_mapper_form in includes/biblio.admin.inc

... See full list

File

./biblio.module, line 2460
Bibliography Module for Drupal.

Code

function biblio_get_map($type, $format) {
  $result = db_select('biblio_type_maps', 'btm')
    ->fields('btm', array(
    $type,
  ))
    ->condition('format', $format)
    ->execute()
    ->fetchField();
  $map = unserialize($result);
  if ($type == 'export_map' && empty($map)) {
    $schema = drupal_get_schema('biblio');
    $fieldnames = array_keys($schema['fields']);
    asort($fieldnames);
    $map = array_fill_keys($fieldnames, 1);
  }
  drupal_alter('biblio_map', $map, $type, $format);
  return $map;
}