I think this could be adapted and integrated with Node and Comments Form Settings

/**
 * Implementation of hook_form_alter()
 * 
 * Some code taken from http://drupal.org/node/225955
 */
function hide_taxonomy_fieldset_form_alter(&$form, $form_state, $form_id) {
	//$form['form_array'] = array('#value' => '<pre>'. print_r($form, 1) . '</pre>');
	if ($form_id == 'node_type_form') {
		
		// Hide taxonomy fieldset
		$form['hide_taxonomy_fieldset'] = array(
			'#type' => 'fieldset',
			'#title' => t("Hide taxonomy fieldset"),
			'#collapsible' => TRUE,
			'#collapsed' => TRUE,
		);

		$form['hide_taxonomy_fieldset']['hide_taxonomy_fieldset_taxonomy'] = array(
			'#title' => t("Display Vocabularies fieldset"),
			'#type' => 'radios',
			'#options' => array('0' => t("Enabled"), '1' => t("Disabled")),
			'#default_value' => variable_get('hide_taxonomy_fieldset_taxonomy_'.  $form['#node_type']->type, 0),
		);
	}
	
	if(isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) {
		$node = $form['#node'];

		// Hide taxonomy fieldset
		if(variable_get('hide_taxonomy_fieldset_taxonomy_'. $node->type, '') == 1) {
			$form['taxonomy']['#title'] = '' ;
			$form['taxonomy']['#collapsible'] = '0' ;
		}

	}
	
}
CommentFileSizeAuthor
hide_taxonomy_fieldset.zip7.08 KBidflorin

Comments

lelizondo’s picture

Nice. The patch needs some work but I like the idea.

I have a couple of questions though.

Is this hiding or removing the fieldset? Will taxonomy still work?

idflorin’s picture

Taxonomy will still work.
This only removes the name "Vocabularies" - I know that this is not a good approach :( , but I think I'll work on it.

lelizondo’s picture

I'm interested, but I think this is not the correct approach, I think this could be so much better and easier:

http://drupal.org/node/739148#comment-3031146

lelizondo’s picture

Assigned: Unassigned » lelizondo
Status: Active » Needs work
lelizondo’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Needs work » Fixed

This was committed and pushed on 6.x-2.x with the approach suggested by @goron posted at http://drupal.org/node/739148#comment-4155846

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.