You are here

function taxonomy_menu_update_7000 in Taxonomy menu 7

Same name and namespace in other branches
  1. 7.2 taxonomy_menu.install \taxonomy_menu_update_7000()

Convert vocabulary ids into vocabulary machine names.

File

./taxonomy_menu.install, line 100
Install and uninstall all required databases. Also do incremental database updates.

Code

function taxonomy_menu_update_7000() {
  $variable_prefixes = array(
    'vocab_menu',
    'vocab_parent',
    'voc_item',
    'display_num',
    'hide_empty_terms',
    'expanded',
    'rebuild',
    'path',
    'menu_end_all',
    'display_descendants',
    'voc_name',
    'sync',
  );
  $vocabularies = taxonomy_get_vocabularies();
  foreach ($vocabularies as $vocabulary) {
    foreach ($variable_prefixes as $prefix) {
      $old_name = 'taxonomy_menu_' . $prefix . '_' . $vocabulary->vid;
      $new_name = 'taxonomy_menu_' . $prefix . '_' . $vocabulary->machine_name;
      if (($value = variable_get($old_name)) !== NULL) {
        variable_set($new_name, $value);
        variable_del($old_name);
      }
    }
  }
}