You are here

function theme_biblio_admin_types_edit_form in Bibliography Module 6.2

Same name and namespace in other branches
  1. 6 biblio_theme.inc \theme_biblio_admin_types_edit_form()
  2. 7 includes/biblio_theme.inc \theme_biblio_admin_types_edit_form()
  3. 7.2 includes/biblio.theme.inc \theme_biblio_admin_types_edit_form()

Creates the HTML for the biblio_admin_types_edit_form().

Parameters

$form:

See also

biblio_admin_types_edit_form()

File

includes/biblio_theme.inc, line 972

Code

function theme_biblio_admin_types_edit_form($form) {
  drupal_add_tabledrag('field-table', 'order', 'sibling', 'weight', NULL, NULL, FALSE);
  $tid = !empty($form['#parameters'][2]) ? $form['#parameters'][2] : FALSE;

  // Build the table with all the fields if no $tid is given, or only the common
  // and customized fields if $tid is given
  $conf_table = array();
  foreach (element_children($form['configured_flds']) as $fld) {
    $form['configured_flds'][$fld]['weight']['#attributes']['class'] = 'weight';
    $conf_row = array();
    $conf_row[] = array(
      'data' => drupal_render($form['configured_flds'][$fld]['name']),
    );
    $conf_row[] = array(
      'data' => drupal_render($form['configured_flds'][$fld]['title']),
    );
    if (isset($form['configured_flds'][$fld]['auth_type'])) {
      $form['configured_flds'][$fld]['hint']['#size'] = 15;
      $conf_row[] = array(
        'data' => drupal_render($form['configured_flds'][$fld]['hint']),
      );
      $conf_row[] = array(
        'data' => drupal_render($form['configured_flds'][$fld]['auth_type']),
      );
    }
    else {
      $form['configured_flds'][$fld]['hint']['#size'] = $tid ? 38 : 36;
      $conf_row[] = array(
        'data' => drupal_render($form['configured_flds'][$fld]['hint']),
        'colspan' => 2,
      );
    }
    foreach (element_children($form['configured_flds'][$fld]['checkboxes']) as $oid) {
      if (is_array($form['configured_flds'][$fld]['checkboxes'])) {
        $conf_row[] = array(
          'data' => drupal_render($form['configured_flds'][$fld]['checkboxes'][$oid]),
          'title' => $oid,
        );
      }
    }
    $conf_row[] = array(
      'data' => drupal_render($form['configured_flds'][$fld]['weight']),
    );
    $conf_table[] = array(
      'data' => $conf_row,
      'class' => 'draggable',
    );
  }
  if ($tid) {
    $header = array(
      t('Field Name'),
      t('Title'),
      t('Hint'),
      '',
      t('Visible'),
      t('Required'),
      t('Weight'),
    );
  }
  else {
    $header = array(
      t('Field Name'),
      t('Default Title'),
      t('Hint'),
      '',
      t('Common'),
      t('Required'),
      t('Autocomplete'),
      t('Weight'),
    );
  }
  $output = '<p>';
  $output .= '<h2>' . drupal_render($form['top_message']) . '</h2>';
  $output .= drupal_render($form['help']);
  $output .= drupal_render($form['type_name']);
  $output .= drupal_render($form['options']);
  $output .= theme('table', $header, $conf_table, array(
    'id' => 'field-table',
  ));
  $output .= '<p><center>' . drupal_render($form['submit']) . '</center></p>';
  $output .= drupal_render($form);
  return $output;
}