--- sites/all/modules/taxonomy_super_select/taxonomy_super_select.module 2009-01-21 14:44:21.000000000 -0800 +++ sites/all/modules/taxonomy_super_selectEDITED/taxonomy_super_select.module 2009-10-15 11:55:02.000000000 -0700 @@ -56,6 +56,20 @@ function taxonomy_super_select_form_alte '#weight' => 2, ); } + $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['tss_collapsible'] = array( + '#type' => 'checkbox', + '#title' => t('Vocabularies are collapsible'), + '#default_value' => variable_get('taxonomy_super_select_collapsible_vid_'. $vid, '1'), + '#description' => t('Vocabularies are collapsible.'), + '#weight' => 10, + ); + $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['tss_collapsed'] = array( + '#type' => 'checkbox', + '#title' => t('Collapse vocabularies'), + '#default_value' => variable_get('taxonomy_super_select_collapsed_vid_'. $vid, '1'), + '#description' => t('Collapse all vocabulary boxes by default. Requires vocabularies to be collapsible.'), + '#weight' => 20, + ); } } @@ -147,7 +161,8 @@ function _tss_branch($vid, $term, $value case 'fieldset': // In this section, $term is actually the vocabulary. // Automatically expand required vocabs or if the parent term is selected - $collapsed = ($required OR $term->parent_value) ? FALSE : TRUE; + $collapsed = (variable_get('taxonomy_super_select_collapsed_vid_'. $vid, '1') && !$required && !$term->parent_value) ? TRUE : FALSE; + $collapsible = (!variable_get('taxonomy_super_select_collapsible_vid_'. $vid, '1') && !$collapsed) ? FALSE : TRUE; if ($term->help) { $help = '
'. $term->help .'
'; } @@ -157,7 +172,7 @@ function _tss_branch($vid, $term, $value $form = array( '#type' => 'fieldset', '#title' => check_plain($term->name) . $required, - '#collapsible' => TRUE, + '#collapsible' => $collapsible, '#collapsed' => $collapsed, '#weight' => ($fieldweight >= 0) ? $fieldweight : $term->weight, '#parents' => array('taxonomy', $vid), @@ -315,7 +330,9 @@ function taxonomy_super_select_submit(&$ 'parents' => $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['parents']['#value'], 'image' => $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['image']['#value'], ); - variable_set('taxonomy_super_select_vid_'. $vid, $tostore); + variable_set('taxonomy_super_select_vid_'. $vid, $tostore); + variable_set('taxonomy_super_select_collapsible_vid_'. $vid, $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['tss_collapsible']['#value']); + variable_set('taxonomy_super_select_collapsed_vid_'. $vid, $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['tss_collapsed']['#value']); } else{ variable_del('taxonomy_super_select_vid_'. $vid);