You are here

function taxonomy_menu_menu_links_insert in Taxonomy menu 7.2

Same name and namespace in other branches
  1. 8 taxonomy_menu.module \taxonomy_menu_menu_links_insert()

Inserts menu links associated to a vocabulary.

Parameters

$vid: The ID of the vocabulary.

2 calls to taxonomy_menu_menu_links_insert()
taxonomy_menu_rebuild in ./taxonomy_menu.module
Rebuilds all the menu items.
taxonomy_menu_vocab_submit in ./taxonomy_menu.admin.inc
Form submission handler for taxonomy_form_vocabulary().

File

./taxonomy_menu.module, line 72
Generates menu links for all selected taxonomy terms.

Code

function taxonomy_menu_menu_links_insert($vid) {

  // Get a list of all the taxonomy terms for that vocabulary and process them
  // using the bacth API.
  $menu_name = taxonomy_menu_variable_get('vocab_menu', $vid, FALSE);
  $terms = taxonomy_get_tree($vid, 0, NULL, TRUE);
  _taxonomy_menu_save_menu_links_batch($terms, $menu_name);
  menu_cache_clear($menu_name);
  drupal_set_message(t('The Taxonomy menu has been created.'), 'status');
}