diff --git a/site_map.admin.inc b/site_map.admin.inc index 98c97aa..9bef305 100644 --- a/site_map.admin.inc +++ b/site_map.admin.inc @@ -123,10 +123,10 @@ function site_map_admin_settings_form() { $form['site_map_taxonomy_options']['site_map_categories_depth'] = array( '#type' => 'textfield', '#title' => t('Categories depth'), - '#default_value' => variable_get('site_map_categories_depth', 'all'), + '#default_value' => variable_get('site_map_categories_depth', NULL), '#size' => 3, '#maxlength' => 10, - '#description' => t('Specify how many subcategories should be included on the categorie page. Enter "all" to include all subcategories, "0" to include no subcategories, or "-1" not to append the depth at all.'), + '#description' => t('Specify how many subcategories should be included on the categorie page. Leave empty to return all levels.'), ); $form['site_map_taxonomy_options']['site_map_term_threshold'] = array( '#type' => 'textfield', diff --git a/site_map.module b/site_map.module index fe1756e..88f35ec 100644 --- a/site_map.module +++ b/site_map.module @@ -512,8 +512,9 @@ function _site_map_taxonomy_tree($vid, $name = NULL, $description = NULL) { $output .= !empty($description) ? '
' . filter_xss_admin($description) . "
\n" : ''; + $site_map_categories_depth = variable_get('site_map_categories_depth') ? variable_get('site_map_categories_depth') : NULL; // taxonomy_get_tree() honors access controls. - $tree = taxonomy_get_tree($vid); + $tree = taxonomy_get_tree($vid, 0, $site_map_categories_depth); foreach ($tree as $term) { $term->count = site_map_taxonomy_term_count_nodes($term->tid); if ($term->count <= $threshold) {