Index: directory.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/directory/directory.module,v
retrieving revision 1.11
diff -u -p -r1.11 directory.module
--- directory.module	28 Dec 2006 03:03:45 -0000	1.11
+++ directory.module	4 Apr 2007 08:41:23 -0000
@@ -45,30 +45,28 @@ function _directory_wd($message, $level=
  ********************************************************************/
 
 /**
- * Implementation of hook_help().
- */
-function directory_help($section = 'admin/help#directory') {
-  switch ($section) {
-    case 'admin/modules#description':
-      return t('Create a directory of resources based on taxonomy (<strong>requires taxonomy.module</strong>)');
-  }
-}
-
-/**
  * Implementation of hook_menu().
  */
 function directory_menu($may_cache) {
   $items = array();
 
   if (!$may_cache) {
-    // inject our css per http://api.drupal.org/api/HEAD/function/hook_init and http://api.drupal.org/api/HEAD/function/hook_menu
-    drupal_set_html_head(theme('stylesheet_import', base_path() . drupal_get_path('module', 'directory') .'/directory.css'));
+    drupal_add_css(drupal_get_path('module', 'directory') .'/directory.css');
   }
 
   if ($may_cache) {
     $items[] = array('path' => 'directory', 'title' => t('directory'), 'callback' => 'directory_page', 'access' => user_access('access content'));
     $items[] = array('path' => 'directory/term', 'title' => t('Advanced directory search'), 'callback' => 'directory_term_page', 'access' => user_access('access content'), 'type' => MENU_CALLBACK);
     $items[] = array('path' => 'directory/random', 'title' => t('Random directory link'), 'callback' => 'directory_random', 'access' => user_access('access content'), 'type' => MENU_CALLBACK);
+    $items[] = array(
+      'path' => 'admin/settings/directory',
+      'title' => t('Directory Settings'),
+      'description' => t('Set which node types and which vocabularies to include, the depth to display on the directory page, etc.'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('directory_admin_settings'),
+      'access' => user_access('administer site configuration'),
+      'type' => MENU_NORMAL_ITEM
+    );
   }
 
   return $items;
@@ -81,7 +79,7 @@ function directory_menu($may_cache) {
 /**
  * Implementation of hook_settings().
  */
-function directory_settings() {
+function directory_admin_settings() {
   $output = '';
 
   if (function_exists('taxonomy_help')) {
@@ -91,8 +89,9 @@ function directory_settings() {
     }
   }
 
-  foreach (node_get_types() as $type => $name) {
-    $nodetypes[$type] = $name;
+  $nodetypes = array();
+  foreach (node_get_types() AS $type) {
+    $nodetypes[$type->type] = $type->name;
   }
 
   $form['module_banner'] = array('#type' => 'markup', 
@@ -105,7 +104,6 @@ function directory_settings() {
   	'#default_value' => variable_get('directory_no_nodes', array()),
   	'#options' => $nodetypes,
   	'#description' => t('<em><strong>Please note:</strong> Any node types that are checked here will <strong>NOT be included</strong> in the directory listings.  All other types will be included.</em>'),
-  	'#attributes' => NULL,
   	'#required' => FALSE,
   );
   $form['directory_vocabularies_root'] = array(
@@ -158,7 +156,7 @@ function directory_settings() {
   	'#description' => t('This text will be displayed at the top of the directory pages.  It is useful for helping or instructing your users.'),
   );
 
-  return $form;
+  return system_settings_form($form);
 }
 
 /********************************************************************
@@ -461,7 +459,7 @@ function directory_display_home_category
       }
       // if desired, exclude items 
       if ((!$hideempty) || $nodecount>0) {
-        $items[] = $item_span . l(_taxonomy_depth($term->depth) . ' '. $term->name, "directory/$term->tid", (($term->description) ? array('title' => $term->description) : array())) 
+        $items[] = $item_span . l(str_repeat('-', $term->depth) .' '. $term->name, "directory/$term->tid", (($term->description) ? array('title' => $term->description) : array())) 
            . $nodecount_span . '</span>';
       }
     }
