You are here

function _biblio_get_field_information in Bibliography Module 6

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

File

./biblio.module, line 41

Code

function _biblio_get_field_information($biblio_type, $only_visible = FALSE) {
  $fields = array();
  $visible = $only_visible ? ' AND (bt.common = 1 OR bt.visible=1) ' : '';
  $result = db_query("SELECT b.*, btd.*, btt.name AS type_name\n                      FROM {biblio_fields} AS b\n                      INNER JOIN {biblio_field_type} AS bt ON bt.fid = b.fid\n                      INNER JOIN {biblio_field_type_data} AS btd ON btd.ftdid = bt.ftdid\n                      INNER JOIN {biblio_types} as btt ON btt.tid = bt.tid\n                      WHERE bt.tid = %d {$visible}\n                      ORDER BY bt.weight ASC", $biblio_type);
  while ($row = db_fetch_array($result)) {
    $fields[$row['fid']] = $row;
  }
  return $fields;
}