You are here

function _biblio_cck_join in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 includes/biblio.import.export.inc \_biblio_cck_join()
  2. 6 biblio.import.export.inc \_biblio_cck_join()
  3. 7.2 includes/biblio.import.export.inc \_biblio_cck_join()

Function _biblio_cck_join($biblio_fields = array()) { // works not with php4.

File

includes/biblio.import.export.inc, line 793
Functions that are used to import and export biblio data.

Code

function _biblio_cck_join(&$biblio_fields) {
  $cck_join = '';

  // Identify records for update operations.
  $biblio_fields['nid'] = 'Node-ID';
  $query_cck_fields = "SELECT field_name, label from {node_field_instance} where type_name='biblio' and not (widget_type='image')";
  $res_cck_fields = db_query($query_cck_fields);
  foreach (${$res_cck_fields} as $rec) {
    $cck_table = 'content_' . $rec->field_name;
    $cck_field = $rec->field_name . '_value';
    $biblio_fields[$cck_field] = $rec->label;
    $cck_join .= ' left join {' . $cck_table . '} on b.vid=' . $cck_table . '.vid';
  }
  return $cck_join;
}