You are here

function _term_level_groups_add_to_tag_clould in Term Level Field 7

Helper function that adds a tag cloud term to the array structure.

1 call to _term_level_groups_add_to_tag_clould()
_term_level_get_groups in ./term_level.module
Returns list of terms, group by their parents or voc.

File

./term_level.module, line 503
Field type for referencing terms with a level to an entity.

Code

function _term_level_groups_add_to_tag_clould(&$groups, $term) {
  $term_parent = end($term->parents);
  if (isset($groups['level_2'][$term_parent])) {
    $top_term_parent = $groups['level_2'][$term_parent]['parent'];
    $groups['tag_cloud'][$top_term_parent]['groups'][$term_parent][$term->tid] = $term;
  }
  else {
    $groups['tag_cloud'][$term_parent]['all'][$term->tid] = $term;
  }
}