Index: project.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/project/project.module,v
retrieving revision 1.233
diff -u -r1.233 project.module
--- project.module	27 Mar 2006 19:23:20 -0000	1.233
+++ project.module	7 Apr 2006 11:51:46 -0000
@@ -45,10 +45,13 @@
         // Extract the different project types, and, for the first type, up to three categories.
         foreach ($tree as $index => $term) {
           if ($term->depth == 0) {
-            $types[] = $term->name;
+            $types[$term->tid] = $term->name;
           }
-          elseif (($term->depth == 1) && ($index == 1) && (count($categories)< 3)) {
-            $categories[] = $term->name;
+          elseif (($term->depth == 1) && count($categories) < 3) {
+            $parents = array_keys($types);
+            if (in_array($parents[0], $term->parents)) {
+              $categories[$index] = $term->name;
+            }
           }
         }
         if (count($categories)) {
@@ -56,7 +59,7 @@
           <ul>
             <li>Select <em>one</em> of the first-level terms (%types) as the project type.</li>
             <li>Then choose <em>one or more</em> categories below this term to classify your project.  For example, for %type, you would choose from the various %type types: %categories, and so on.</li>
-          </ul>', array('%types' => implode (', ', $types), '%type' => $types[0], '%categories' => implode (', ', $categories)));
+          </ul>', array('%types' => implode (', ', $types), '%type' => array_shift($types), '%categories' => implode (', ', $categories)));
         }
       }
       $help .= variable_get('project_help_node_add', '');

