You are here

function _taxonomy_menu_update_all_parents in Taxonomy menu 7

Same name and namespace in other branches
  1. 8 taxonomy_menu.module \_taxonomy_menu_update_all_parents()
  2. 7.2 taxonomy_menu.module \_taxonomy_menu_update_all_parents()

Updates all parent items.

Parameters

string $op: options are 'insert', 'update', 'delete' or path.

$node: The node object.

1 call to _taxonomy_menu_update_all_parents()
_taxonomy_menu_nodeapi_helper in ./taxonomy_menu.module
Builds argument arrays calls taxonomy_menu_handler.

File

./taxonomy_menu.module, line 569
Adds links to taxonomy terms into a menu.

Code

function _taxonomy_menu_update_all_parents($term, $menu_name) {
  $parents = taxonomy_get_parents($term->tid);
  if ($parents) {
    foreach ($parents as $parent) {
      $parent->parents = array_keys(taxonomy_get_parents($parent->tid));
      $item = array(
        'term' => $parent,
        'menu_name' => $menu_name,
        'mlid' => _taxonomy_menu_get_mlid($parent->tid, $parent->vid),
        'remove' => FALSE,
      );
      taxonomy_menu_handler('update', $item);
      _taxonomy_menu_update_all_parents($parent, $menu_name);
    }
  }
}