You are here

function hierarchical_select_taxonomy_form_vocabulary_validate in Hierarchical Select 6.3

Same name and namespace in other branches
  1. 5.3 modules/hs_taxonomy.module \hierarchical_select_taxonomy_form_vocabulary_validate()
  2. 5.2 modules/taxonomy.inc \hierarchical_select_taxonomy_form_vocabulary_validate()

Additional validate callback for the taxonomy_form_vocabulary form.

1 string reference to 'hierarchical_select_taxonomy_form_vocabulary_validate'
hs_taxonomy_form_taxonomy_form_vocabulary_alter in modules/hs_taxonomy.module

File

modules/hs_taxonomy.module, line 755
Implementation of the Hierarchical Select API for the Taxonomy module.

Code

function hierarchical_select_taxonomy_form_vocabulary_validate($form, &$form_state) {

  // The "multiple select" setting doesn't exist for the forum vocabulary!
  if ($form_state['values']['hierarchical_select_status'] && isset($form['settings']['multiple'])) {

    // Enable Taxonomy's "multiple select" setting when:
    // - Hierarchical Select's "multiple select" setting is enabled, or:
    // - Hierarchical Select's "save term lineage" setting is enabled
    $multiple_select_enabled = isset($form_state['values']['hierarchical_select']['dropbox']['status']) && $form_state['values']['hierarchical_select']['dropbox']['status'] || $form_state['values']['hierarchical_select']['save_lineage'];
    form_set_value($form['settings']['multiple'], (int) $multiple_select_enabled, $form_state);
  }

  // If Hierarchical Select is enabled, disable freetagging.
  if ($form_state['values']['hierarchical_select_status']) {
    form_set_value($form['settings']['tags'], 0, $form_state);
  }
}