? devel
? flexinode
? htmltidy
? i18n
? legal
? localegettext
Index: taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy.module,v
retrieving revision 1.129
diff -u -r1.129 taxonomy.module
--- taxonomy.module	10 Jul 2004 15:51:48 -0000	1.129
+++ taxonomy.module	22 Jul 2004 21:48:58 -0000
@@ -16,6 +16,52 @@
     node_feed($result, $channel);
   }
 }
+/**
+ * Queries the database for the feed data. 
+ * Also sets the breadcrumb, the menu and a meta tag for the the feed equivalent.
+ *
+ */
+function taxonomy_list($taxonomy) {
+    $sql = 'SELECT name, description FROM {term_data} WHERE tid IN (%s)';
+    $result = db_query($sql, $taxonomy->str_tids);
+    $names = array();
+    while ($term = db_fetch_object($result)) {
+      $terms[] = array('name' => $term->name, 'description'=>$term->description);
+    }
+    
+    // Build breadcrumb based on first hierarchy of first term:
+    $current->tid = $taxonomy->tids[0];
+    $breadcrumbs = array(array('path' => $_GET['q']));
+    while ($parents = taxonomy_get_parents($current->tid)) {
+    $current = array_shift($parents);
+    $breadcrumbs[] = array('path' => 'taxonomy/view/or/'. $current->tid, 'title' => $current->name);
+    }
+    $breadcrumbs = array_reverse($breadcrumbs);
+    menu_set_location($breadcrumbs);
+
+    drupal_set_html_head('<link rel="alternate" type="application/rss+xml" title="RSS - '. implode(' : ', $names) .'" href="'. url("taxonomy/feed/or/$taxonomy->str_tids") .'" />');
+
+    theme("taxonomy_render_list", $taxonomy, $terms);
+}
+/**
+ * Themeable list render function.
+ *
+ * This function will return a single string containing all the nodes in a list,
+ * and the description of the called term(s). 
+ * This function is themeable. 
+ *
+ */
+function theme_taxonomy_render_list($taxonomy, $terms = array()) {
+    foreach ($terms as $term) {
+      if(!empty($term['description'])) {
+        $output .= theme("box",$term['name'],check_output($term['description']));
+      }
+      $names[] = $term['name'];
+    }
+    
+    $output .= taxonomy_render_nodes(taxonomy_select_nodes($taxonomy));
+    print theme('page', $output, implode(', ', $names));
+}
 
 /**
  * Implementation of hook_perm().
@@ -835,28 +881,7 @@
         taxonomy_feed($taxonomy);
       break;
       default:
-      // Build title:
-      $sql = 'SELECT name FROM {term_data} WHERE tid IN (%s)';
-      $result = db_query($sql, $taxonomy->str_tids);
-      $names = array();
-      while ($term = db_fetch_object($result)) {
-        $names[] = $term->name;
-      }
-
-      // Build breadcrumb based on first hierarchy of first term:
-      $current->tid = $taxonomy->tids[0];
-      $breadcrumbs = array(array('path' => $_GET['q']));
-      while ($parents = taxonomy_get_parents($current->tid)) {
-        $current = array_shift($parents);
-        $breadcrumbs[] = array('path' => 'taxonomy/view/or/'. $current->tid, 'title' => $current->name);
-      }
-      $breadcrumbs = array_reverse($breadcrumbs);
-      menu_set_location($breadcrumbs);
-
-      drupal_set_html_head('<link rel="alternate" type="application/rss+xml" title="RSS - '. implode(' : ', $names) .'" href="'. url("taxonomy/feed/or/$taxonomy->str_tids") .'" />');
-
-      $output = taxonomy_render_nodes(taxonomy_select_nodes($taxonomy));
-      print theme('page', $output, implode(', ', $names));
+        taxonomy_list($taxonomy);
       break;
     }
   }
