diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-09-11 08:18:24 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-09-11 08:18:24 +0000 |
commit | 1081f927323104993d8a78e356d5b0a6766bf992 (patch) | |
tree | 5670d4aa0786b1b747530cb448c1a1e41c0c74e4 /modules/taxonomy/taxonomy.module | |
parent | 428a86e60fc9f12068d7ef121d718488b8346830 (diff) | |
download | brdo-1081f927323104993d8a78e356d5b0a6766bf992.tar.gz brdo-1081f927323104993d8a78e356d5b0a6766bf992.tar.bz2 |
#41484 by nickl, flk, and budda. Don't wrap the category selection in a fieldset if there is only one vocabulary.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 3be800183..b64447a4c 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -672,8 +672,21 @@ function taxonomy_form_alter($form_id, &$form) { $form['taxonomy'][$vocabulary->vid]['#required'] = $vocabulary->required; } } - if (isset($form['taxonomy'])) { - $form['taxonomy'] += array('#type' => 'fieldset', '#title' => t('Categories'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#tree' => TRUE, '#weight' => -3); + if (is_array($form['taxonomy']) && !empty($form['taxonomy'])) { + if (count($form['taxonomy']) > 1) { // Add fieldset only if form has more than 1 element. + $form['taxonomy'] += array( + '#type' => 'fieldset', + '#title' => t('Categories'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#tree' => TRUE, + '#weight' => -3, + ); + } + else { + $form['taxonomy'] = array_shift($form['taxonomy']); + $form['taxonomy']['#weight'] = -3; + } } } } |