Index: directory.css =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/directory/directory.css,v retrieving revision 1.4.2.2 diff -u -p -r1.4.2.2 directory.css --- directory.css 22 May 2007 06:11:58 -0000 1.4.2.2 +++ directory.css 3 Jun 2007 01:28:35 -0000 @@ -24,3 +24,25 @@ table.directory-resources ul li { displa table.directory-resources { width: 98%; } table.directory-resources { margin-top: 1em; margin-bottom: .25em; } table.directory-resources tr td { width: 50%; } /* make columns evenly spaced */ + +/* Controls the javascript collapsible vocabs on the main page */ +div.directory-home-vocabulary-collapsible { + margin-top: 1em; +} + +div.directory-home-vocabulary-collapsible h3{ + display: inline; +} + +.directory-home-toggle-link { + text-decoration: underline; + color: blue; + padding-left: 3em; + font-size: 80%; +} + +.directory-home-toggle-link:hover { + cursor:pointer; + color: red; +} + Index: directory.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/directory/directory.module,v retrieving revision 1.11.2.24 diff -u -p -r1.11.2.24 directory.module --- directory.module 2 Jun 2007 10:32:50 -0000 1.11.2.24 +++ directory.module 3 Jun 2007 01:28:37 -0000 @@ -115,6 +115,17 @@ function directory_admin_settings() { '#extra' => 0, '#multiple' => TRUE, ); + + $form['directory_vocabularies_collapsed'] = array( + '#type' => 'select', + '#title' => t('Which vocabularies are collapsed by default?'), + '#description' => t('The checked vocabularies will be collapsed by default if they are shown on the main directory page.'), + '#options' => $vocs, + '#default_value' => variable_get('directory_vocabularies_collapsed', array()), + '#required' => FALSE, + '#extra' => 0, + '#multiple' => TRUE, + ); $form['directory_show_child_counts'] = array( '#type' => 'checkbox', @@ -377,7 +388,15 @@ function theme_directory_home_vocabulary $vocabulary = taxonomy_get_vocabulary($vid); $terms = taxonomy_get_children(0, $vid); - $output = '
'; + $collapsed_vids = variable_get('directory_vocabularies_collapsed', array()); + $collapsed_string = ''; + if (in_array($vid, $collapsed_vids)) { + $collapsed_string = 'directory-home-vocabulary-collapsed'; + } + drupal_add_js(drupal_get_path('module', 'directory') .'/directory.js'); + drupal_add_js("var toggleT = ". drupal_to_js(t('toggle')) .';', 'inline'); + + $output = '
'; $output .= theme('directory_list_terms', $terms, t('By %vocabulary-name', array('%vocabulary-name' => $vocabulary->name))); $output .= '
';