You are here

function _biblio_get_field_information in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 biblio.module \_biblio_get_field_information()
  2. 6 biblio.module \_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 includes/biblio_theme.inc

File

includes/biblio_theme.inc, line 194

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 = :tid {$visible}\n                      ORDER BY bt.weight ASC", array(
    ':tid' => $biblio_type,
  ), array(
    'fetch' => PDO::FETCH_ASSOC,
  ));
  foreach ($result as $row) {
    $fields[$row['fid']] = $row;
  }
  return $fields;
}