You are here

content.biblio.inc in Bibliography Module 6.2

Functions regarding content extra fields for Drupal biblio module.

File

includes/content.biblio.inc
View source
<?php

/**
 * @file
 * Functions regarding content extra fields for Drupal biblio module.
 */

/**
 * Creates additional form fields for the biblio content type.
 *
 * @param string $type_name
 *
 *
 * @return array
 *
 */
function _biblio_content_extra_fields($type_name) {
  $extras = array();
  if ($type_name == 'biblio') {
    $result = db_query("SELECT * FROM {biblio_fields} b\n              INNER JOIN {biblio_field_type} bt ON b.fid = bt.fid\n              INNER JOIN {biblio_field_type_data} btd ON btd.ftdid=bt.ftdid\n              WHERE bt.tid=0 ORDER BY bt.weight ASC");
    while ($row = db_fetch_array($result)) {
      $fields[$row['name']] = $row;
    }
    _biblio_localize_fields($fields);
    $extras['biblio_type'] = array(
      'label' => t('Publication Type'),
      'description' => t('Biblio module form.'),
      'weight' => -4,
    );
    foreach ($fields as $key => $fld) {
      $label = check_plain($fld['title']);
      if ($fld['type'] == 'textarea' || $fld['type'] == 'contrib_widget') {
        $key = $key . '_field';
        $label = $label . ' (' . t('Fieldset') . ')';
      }
      $extras[$key] = array(
        'label' => $label,
        'description' => t('Biblio module form.'),
        'weight' => $fld['weight'] / 10,
      );
    }
    $extras['other_fields'] = array(
      'label' => t('Other Biblio Fields') . ' (' . t('Fieldset') . ')',
      'description' => t('Biblio module form.'),
      'weight' => 0,
    );
  }
  return $extras;
}

Functions

Namesort descending Description
_biblio_content_extra_fields Creates additional form fields for the biblio content type.