You are here

function taxonomy_manager_update_voc in Taxonomy Manager 7

Same name and namespace in other branches
  1. 6.2 taxonomy_manager.admin.inc \taxonomy_manager_update_voc()
  2. 6 taxonomy_manager.admin.inc \taxonomy_manager_update_voc()

Helper function that updates the hierarchy settings of a voc

5 calls to taxonomy_manager_update_voc()
taxonomy_manager_copy in ./taxonomy_manager.admin.inc
Duplicates a term to another voc
taxonomy_manager_double_tree_move_submit in ./taxonomy_manager.admin.inc
taxonomy_manager_form_move_submit in ./taxonomy_manager.admin.inc
Submit handler for moving terms
taxonomy_manager_switch in ./taxonomy_manager.admin.inc
Changes vocabulary of given terms and its children conflicts might be possible with multi-parent terms!
taxonomy_manager_term_data_form_submit_parents_add in ./taxonomy_manager.admin.inc
Submit handler for adding parents for a term.

File

./taxonomy_manager.admin.inc, line 2788

Code

function taxonomy_manager_update_voc($vid, $parents = array()) {
  $voc = taxonomy_vocabulary_load($vid);
  if ($voc->vid == $vid) {
    $current_hierarchy = count($parents);
    if ($current_hierarchy > 2) {
      $current_hierarchy = 2;
    }
    if ($current_hierarchy > $voc->hierarchy) {
      $voc->hierarchy = $current_hierarchy;
      taxonomy_vocabulary_save($voc);
    }
  }
}