? .project Index: site_map.module =================================================================== RCS file: /cvs/drupal/contributions/modules/site_map/site_map.module,v retrieving revision 1.39.2.17.2.8 diff -u -p -r1.39.2.17.2.8 site_map.module --- site_map.module 22 May 2010 07:42:48 -0000 1.39.2.17.2.8 +++ site_map.module 23 May 2010 18:36:34 -0000 @@ -311,10 +311,14 @@ function _site_map_taxonomys() { /** * Render taxonomy tree * - * @param $tree The results of taxonomy_get_tree() with optional 'count' fields. - * @param $name An optional name for the tree. (Default: NULL) - * @param $description An optional description of the tree. (Default: NULL) - * @return A string representing a rendered tree. + * @param $vid + * A vocabulary ID. + * @param $name + * An optional name for the tree. + * @param $description + * An optional description of the tree. + * @return + * A string representing a rendered tree. */ function _site_map_taxonomy_tree($vid, $name = NULL, $description = NULL) { $output = ''; @@ -344,76 +348,165 @@ function _site_map_taxonomy_tree($vid, $ $output .= !empty($description) ? '
'. filter_xss_admin($description) ."
\n" : ''; // taxonomy_get_tree() honors access controls - $tree = taxonomy_get_tree($vid); - foreach ($tree as $term) { - $term->count = taxonomy_term_count_nodes($term->tid); - if ($term->count <= $threshold) { - continue; - } - - if (module_exists('i18ntaxonomy')) { - $term->name = tt("taxonomy:term:$term->tid:name", $term->name); - } - - // Adjust the depth of the \n"; + else { + foreach ($terms as $tid => $term) { + if ($term->depth === $depth) { + foreach ($term->parents as $parent) { + $terms[$parent]->childrens[] = $term->link . $term->children; + } + unset($terms[$term->tid]); + } + } + foreach ($terms as $tid => $term) { + if ($term->childrens) { + $term->children = "\n$spacing\n"; + } } + $output .= _site_map_taxonomy_list($terms, ($depth - 1)); } - $output = theme('site_map_box', $title, $output, 'site-map-terms-box site-map-terms-box-'. $vid . $class); - return $output; }