You are here

function _biblio_get_field_information in Bibliography Module 6.2

Same name and namespace in other branches
  1. 6 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()

Retrieves field information based upon biblio type.

Parameters

string $biblio_type: The type of biblio to retrieve field information about.

bool $only_visible: (optional) A logical flag indicating whether to only return visible fields. The default is FALSE which indicates information on all fields for this biblio_type should be returned.

Return value

array An associative array keyed by integer of field ID.

1 call to _biblio_get_field_information()
theme_biblio_tabular in includes/biblio_theme.inc

File

./biblio.module, line 88
Main file for Drupal module biblio.

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;
}