You are here

function theme_taxonomy_defaults_form in Taxonomy Defaults 5

Same name and namespace in other branches
  1. 6.2 taxonomy_defaults.admin.inc \theme_taxonomy_defaults_form()
  2. 6 taxonomy_defaults.admin.inc \theme_taxonomy_defaults_form()
  3. 7 taxonomy_defaults.admin.inc \theme_taxonomy_defaults_form()

Renders the settings form in a table

File

./taxonomy_defaults.module, line 152
Taxonomy defaults - allows assignment of default terms to node types, either

Code

function theme_taxonomy_defaults_form($form) {
  drupal_add_css(drupal_get_path('module', 'taxonomy_defaults') . '/taxonomy_defaults.css', 'module', 'all', FALSE);
  foreach (node_get_types() as $type => $name) {
    $table[$type][] = array(
      'data' => $name->name,
      'class' => 'taxdef-name',
    );
    $rowcount = 0;
    foreach (element_children($form[$type]) as $key) {
      $vocabtable[$rowcount][] = drupal_render($form[$type][$key]['active']);
      $vocabtable[$rowcount][] = drupal_render($form[$type][$key]['select']);
      $rowcount++;
    }
    $subtable = theme('table', array(), $vocabtable);
    unset($vocabtable);
    $table[$type][] = array(
      'data' => $subtable,
      'class' => 'taxdef-subtable',
    );
  }
  $output = theme('table', array(
    t('content type'),
    t('vocabularies and terms'),
  ), $table);

  // Render remaining fields
  $output .= drupal_render($form);
  return $output;
}