--- C:/original/indexpage.module Tue Oct 21 18:08:16 2008 +++ C:/modified/indexpage.module Wed Oct 22 14:54:12 2008 @@ -146,7 +146,16 @@ '#title' => t('Show vocabulary filters for this node type'), '#return_value' => 1, '#default_value' => variable_get($var_prefix .'_vocfilter', 1), - ); + ); + + // Add treeview Support + $form[$set][$var_prefix .'_treeview'] = array( + '#type' => 'checkbox', + '#title' => t('Show vocabulary filters within a Tree View'), + '#return_value' => 1, + '#default_value' => variable_get($var_prefix .'_treeview', 1), + ); + } else { $form[$set][$var_prefix .'_vocfilter'] = array( @@ -222,9 +231,30 @@ } function indexpage_page($type, $op = NULL) { - global $user; + global $user; + + // if there is only one type, go directly to it!! + if ( !arg(1) ){ + $how_much_to_show = 0; + $the_type = ""; + $types = node_get_types('names'); + foreach ($types as $type => $name) { + if (variable_get('indexpage_'. $type .'_enable', 1)) { + $how_much_to_show += 1; + $the_type = $type; + } + } + + if ($how_much_to_show == 1) + $arg_1 = $the_type; + $arg_2 = arg(2); + } else { + $arg_1 = arg(1); + $arg_2 = arg(2); + } + // Is this the overview index? - if (!arg(1)) { + if (!$arg_1) { $output .= '
'; $output .= nl2br(variable_get('indexpage_description', '')); $output .= '