Index: directory.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/directory/directory.module,v
retrieving revision 1.11
diff -u -r1.11 directory.module
--- directory.module	28 Dec 2006 03:03:45 -0000	1.11
+++ directory.module	17 Mar 2007 22:51:52 -0000
@@ -8,7 +8,7 @@
 // http://amadorable.com/directory
 // http://www.ent.iastate.edu/list/
 
-define('DIRECTORY_MODULE_VERSION', '$Id: directory.module,v 1.11 2006/12/28 03:03:45 inactivist Exp $');
+define('DIRECTORY_MODULE_VERSION', '$Id: directory.module,v 0.1 2006/12/28 03:03:45 bpocanada Exp $');
 
 /**
  * Set this to TRUE to enable diagnostics.  If TRUE, requires ed_module_support.module 
@@ -67,8 +67,21 @@
 
   if ($may_cache) {
     $items[] = array('path' => 'directory', 'title' => t('directory'), 'callback' => 'directory_page', 'access' => user_access('access content'));
+	// two callback menu
     $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);
+	
+	/** for drupal 5 **/ 
+	$items[] = array(
+    'path' => 'admin/settings/directory',
+    'title' => t('Directory'),
+    'description' => t('Directory of this site.'),
+    'callback' => 'drupal_get_form',
+    'callback arguments' => array('directory_admin_settings'),
+    'access' => user_access('administer site configuration'),
+    'type' => MENU_NORMAL_ITEM, // optional
+   );
+   
   }
 
   return $items;
@@ -81,7 +94,7 @@
 /**
  * Implementation of hook_settings().
  */
-function directory_settings() {
+function directory_admin_settings() {
   $output = '';
 
   if (function_exists('taxonomy_help')) {
@@ -90,9 +103,9 @@
       $vocs[$vid] = $voc->name;
     }
   }
-
+  $nodetypes = array();
   foreach (node_get_types() as $type => $name) {
-    $nodetypes[$type] = $name;
+    $nodetypes[$type] = t($name->name);
   }
 
   $form['module_banner'] = array('#type' => 'markup', 
@@ -105,7 +118,7 @@
   	'#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,
+  	/* '#attributes' => NULL,  for drupal 5 http://drupal.org/node/64279#comment-199174 */
   	'#required' => FALSE,
   );
   $form['directory_vocabularies_root'] = array(
@@ -157,7 +170,10 @@
   	'#rows' => 5,
   	'#description' => t('This text will be displayed at the top of the directory pages.  It is useful for helping or instructing your users.'),
   );
-
+ 
+  // added for drupal 5 
+  return system_settings_form($form);
+   
   return $form;
 }
 
@@ -175,9 +191,11 @@
     // Get a list of subcategories
     $subcats  = directory_display_category($tid); // can return NULL if nothing available
     if (DIRECTORY_MODULE_DEBUG) ed_module_support_vd($subcats, 'display_category returns');
+	
     $content .= directory_display_resource($tid, $filter, $fid); // can return NULL if nothing available
+	
     if (DIRECTORY_MODULE_DEBUG) ed_module_support_vd($content, 'display_resource returns');
-    if (!$subcats && !$content) {
+    if (!$subcats && !$content) { 
       $output .= t('<p class="directory-no-resources-available">There are no items in this category.  Please choose another.</p>');
     } else {
       $output .= $content;
@@ -331,7 +349,7 @@
         $joins .= ' INNER JOIN {term_node} tn'. $index .' ON n.nid = tn'. $index .'.nid';
         $wheres .= ' AND tn'. $index .'.tid IN ('. implode(',', $tids) .')';
       }
-      $sql_fetch = db_rewrite_sql('SELECT DISTINCT(n.nid), n.* {node} n '. $joins .' WHERE n.status = 1 '. $wheres .' ORDER BY n.sticky DESC, n.title ASC');
+      $sql_fetch = db_rewrite_sql('SELECT DISTINCT(n.nid), n.* FROM {node} n '. $joins .' WHERE n.status = 1 '. $wheres .' ORDER BY n.sticky DESC, n.title ASC');
       $sql_count = db_rewrite_sql('SELECT COUNT(DISTINCT(n.nid)) FROM {node} n '. $joins .' WHERE n.status = 1 '. $wheres .' ORDER BY n.sticky DESC, n.title ASC');
     }
 
@@ -461,7 +479,7 @@
       }
       // 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>';
       }
     }


?directory.info

; $Id: directory.info,v 1.1 2007/02/15 20:55:34 dks Exp $
name = Directory
description = This is for making taxonomy as directoty.
package = Directory Specific
version = VERSION

; Information added by drupal.org packaging script on 2007-01-30
version = "5.0.1"
