function taxonomy_defaults_settings() {
  drupal_set_title("Default Terms");
  $types = node_list();
  foreach ((array)$types as $type) {
    $table[$type][] = array('data'=>"<strong>".node_invoke($type, 'node_name')."</strong>", 'style'=>'padding:5px;border:2px solid #CCC');
    unset($output);
    unset($subtable);
    $typevocabs = taxonomy_get_vocabularies($type);
    foreach ((array)taxonomy_get_vocabularies() as $vid => $vocab) {
      // is this vocab an active vocab for this node-type?
      $activevocab = (key_exists($vid, $typevocabs)) ? TRUE : FALSE ;
      $subtable[$vocab->vid][1] = form_checkbox($activevocab ? 'active&nbsp;' : '<i>active</i>&nbsp;', 'taxdef_'.$type.'_'.$vocab->vid.'_active', 1, variable_get('taxdef_'.$type.'_'.$vocab->vid.'_active', FALSE));
      $subtable[$vocab->vid][2] = taxonomy_form($vocab->vid, variable_get('taxdef_'.$type.'_'.$vocab->vid, 0), NULL, 'taxdef_'.$type.'_'.$vocab->vid);
    }
    $output .= theme('table', '', $subtable);
    $table[$type][] = array('data'=>$output, 'style'=>'padding:5px;border:2px solid #CCC');
  }
  $output = theme('table', array('content type', 'vocabularies and terms'), $table);
  return $output;
}

I can't believe that I can't upgrade this myself... No matter what I do to it I get one error or another. PLEASE HELP?!!!

I'm starting to think that maybe taxonomy doesn't work like it did in 4.6?

Thanks

Pobster

Comments

pobster’s picture

I tried this:

$subtable[$vocab->vid][1] = theme('form_element', NULL, '<label class="option"><input type="checkbox" class="form-checkbox" name="edit['.'taxdef_'.$type.'_'.$vocab->vid.'_active'.']"
 id="edit-'.'taxdef_'.$type.'_'.$vocab->vid.'_active'.'" value="'.variable_get('taxdef_'.$type.'_'.$vocab->vid.'_active', FALSE).'" /> <i>active</i>&nbsp;</label>');

Which I believe worked... Sort of... But I'm getting errors elsewhere in the code which prevents it from displaying. And anyways... It's messy and probably won't work doing it that way... I'm stumped?

Pobster