--- site_map/site_map.module 2008-02-08 07:21:59.000000000 +0000
+++ site_map.module.fixed 2008-03-09 04:13:01.000000000 +0000
@@ -477,22 +477,32 @@
$output .= '
';
// taxonomy_get_tree() honors access controls
$tree = taxonomy_get_tree($vid);
+
+ $indentation_string = ' ';
+
foreach ($tree as $term) {
+ $indent = str_repeat($indentation_string, $term->depth);
+
// Adjust the depth of the
based on the change
// in $term->depth since the $last_depth.
if ($term->depth > $last_depth) {
for ($i = 0; $i < ($term->depth - $last_depth); $i++) {
- $output .= '';
+ $output .= "\n$indent\n";
}
}
+ else if ($term->depth == $last_depth) {
+ $output .= "\n";
+ }
else if ($term->depth < $last_depth) {
for ($i = 0; $i < ($last_depth - $term->depth); $i++) {
- $output .= '
';
+ $output .= "\n$indent
\n\n";
}
}
// Display the $term.
- $output .= '- ';
+ $output .= "$indent
- ";
+
$term->count = taxonomy_term_count_nodes($term->tid);
+
if ($term->count) {
if ($cat_depth < 0) {
$output .= l($term->name, taxonomy_term_path($term), array('title' => $term->description));
@@ -511,10 +521,7 @@
$output .= ' '. theme('site_map_feed_icon', url("taxonomy/term/$term->tid/$rss_depth/feed"));
$output .= (module_exists('commentrss') ? ' '. theme('site_map_feed_icon', url("crss/term/$term->tid"), 'comment') : '');
}
-
-
-
- $output .= "
\n";
+
// Reset $last_depth in preparation for the next $term.
$last_depth = $term->depth;
}
@@ -522,7 +529,7 @@
// Bring the depth back to where it began, -1.
if ($last_depth > -1) {
for ($i = 0; $i < ($last_depth + 1); $i++) {
- $output .= '
';
+ $output .= "\n";
}
}
$output .= "
\n";