You are here

function _taxonomy_menu_children_has_nodes in Taxonomy menu 6.2

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

Helper function to see if any of the children have any nodes

Parameters

$tid:

$vid:

Return value

boolean

2 calls to _taxonomy_menu_children_has_nodes()
taxonomy_menu_translated_menu_link_alter in ./taxonomy_menu.module
Implementation of hook_translated_menu_link_alter().
_taxonomy_menu_item in ./taxonomy_menu.module
Helper function for insert and update hooks

File

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

Code

function _taxonomy_menu_children_has_nodes($tid, $vid, $has_nodes = FALSE) {
  if (!$has_nodes) {
    $children = taxonomy_get_children($tid, $vid);
    foreach ($children as $tid => $term) {
      if (_taxonomy_menu_term_count($tid) > 0) {
        return _taxonomy_menu_children_has_nodes($tid, $vid, TRUE);
      }
    }
  }
  return $has_nodes;
}