You are here

function _biblio_get_auth_types in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 biblio.module \_biblio_get_auth_types()
  2. 6 biblio.module \_biblio_get_auth_types()
  3. 7.2 biblio.module \_biblio_get_auth_types()
1 call to _biblio_get_auth_types()
_biblio_get_auth_type in ./biblio.module

File

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

Code

function _biblio_get_auth_types($auth_category, $biblio_type) {
  static $auth_types = array();
  if (empty($auth_types)) {
    $db_res = db_query("SELECT * FROM {biblio_contributor_type}");
    foreach ($db_res as $row) {
      $auth_types[$row->auth_category][$row->biblio_type][] = $row->auth_type;
    }
  }

  // Fall back to defaults, if no author types are defined for this biblio_type.
  $result = isset($auth_types[$auth_category][$biblio_type]) ? $auth_types[$auth_category][$biblio_type] : $auth_types[$auth_category][0];
  return $result;
}