function _taxonomy_menu_update_link_items in Taxonomy menu 6.2
Same name and namespace in other branches
- 7 taxonomy_menu.module \_taxonomy_menu_update_link_items()
Update the menu items
Parameters
$vid: vocab id
1 call to _taxonomy_menu_update_link_items()
- taxonomy_menu_vocab_submit in ./
taxonomy_menu.module - Submit handler for the extra settings added to the taxonomy vocab form.
File
- ./
taxonomy_menu.module, line 204 - It Generates menu links for all selected taxonomy terms
Code
function _taxonomy_menu_update_link_items($vid) {
// rebuild vocab 'taxonomy_menu_voc_item_' . $vid
$menu_name = variable_get('taxonomy_menu_vocab_menu_' . $vid, FALSE);
// get a list of the current menu links
$menu_links = _taxonomy_menu_get_menu_items($vid);
// cycle through the
foreach ($menu_links as $tid => $mlid) {
if ($tid == 0) {
$args['vid'] = $vid;
}
else {
$args['term'] = taxonomy_get_term($tid);
// since taxonomy_get_term does not return the parents, fetch them now
$args['term']->parents = _taxonomy_menu_get_parents($tid);
}
// set the menu name
$args['menu_name'] = $menu_name;
$args['mlid'] = $mlid;
// update the menu link
taxonomy_menu_handler('update', $args);
}
return t('The Taxonomy Menu %menu_name has been updated.', array(
'%menu_name' => $menu_name,
));
}