Index: feature.module
===================================================================
RCS file: /var/cvs/Drupal-i18n/modules/Attic/feature.module,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 feature.module
--- feature.module	11 Apr 2005 16:17:26 -0000	1.1.2.5
+++ feature.module	11 Apr 2005 22:27:42 -0000
@@ -1,11 +1,15 @@
 <?php
 // $Id: feature.module,v 1.1.2.5 2005/04/11 16:17:26 jose Exp $
 
-$GLOBALS["categories"] = array("General features", "Templating", "User management", "Content management", "Blogging", "Security", "Platform", "Administration and analysis", "Compatibility", "Community features", "Performance and scalability");
+function feature_categories() {
+  return array(t("General features"), t("Templating"), t("User management"), t("Content management"), t("Blogging"), t("Security"), t("Platform"), t("Administration and analysis"), t("Compatibility"),  t("Community features"), t("Performance and scalability"));
+}
 
-function feature_system($field) {
-  $system["description"] = t("Spartan module to display a feature list.");
-  return $system[$field];
+function feature_help($section){
+  switch ($section) {
+    case 'admin/modules#description':
+      return t("Spartan module to display a feature list.");
+  }
 }
 
 function feature_perm() {
@@ -20,8 +24,7 @@
     'callback' => 'feature_admin', 'access' => $access);
   $items[] = array('path' => 'admin/node/feature/add', 'title' => t('add feature'),
     'callback' => 'feature_admin', 'access' => $access,
-    'type' => MENU_LOCAL_TASK);
-
+    );
   return $items;
 }
 
@@ -30,10 +33,8 @@
 }
 
 function feature_form($edit = array()) {
-  global $categories;
-
   $form .= form_textfield(t("Name"), "name", $edit["name"], 50, 128, t("The name or short description of the feature."));
-  $form .= form_select(t("Category"), "category", $edit["category"], $categories, t("The category this feature belongs to."));
+  $form .= form_select(t("Category"), "category", $edit["category"], feature_categories(), t("The category this feature belongs to."));
   $form .= form_textarea(t("Description"), "description", $edit["description"], 55, 5, t("A description of the feature."));
   $form .= form_textfield(t("Details-link"), "details", $edit["details"], 50, 255, t("The URL of a page or website with detailed information about the feature."));
   $form .= form_textfield(t("Image-link"), "image", $edit["image"], 50, 255, t("The URL of a page or website with a screenshot or image of the feature."));
@@ -61,7 +62,7 @@
 }
 
 function feature_display() {
-  global $categories;
+  $categories = feature_categories();
 
   $result = db_query("SELECT * FROM {feature} ORDER BY name");
 
@@ -75,7 +76,7 @@
 
 function feature_listing() {
 
-  global $categories;
+  $categories = feature_categories();
 
   $result = db_query("SELECT * FROM {feature} ORDER BY category, name");
 
@@ -130,4 +131,28 @@
   print theme('page', $output);
 }
 
+function feature_overview(){
+  $categories = feature_categories();
+
+  $result = db_query("SELECT * FROM {feature} ORDER BY category, name");
+
+  $header = array(t("name"), t("description"), t("category"), t("details"), t("image"), array("data" => t("operations"), "colspan" => 2));
+  $category = null;
+  while ($feature = db_fetch_object($result)) {
+    if ($feature->category != $category){
+      // New category
+      $category = $feature->category;
+      $output .= '<h2>'.$categories[$category].'</h2>';
+    }
+    $output .= '<p><i>'.$feature->name.'</i>&nbsp;'.$feature->description.'</p>';
+    $links = array();
+    if($feature->details) $links[]=l($feature->details, $feature->details);
+    if($feature->image) $links[]="<a href=\"$feature->image\">".t('screenshot')."</a>"  ;
+    if(!empty($links)){
+      $output .= '<div style="text-align:right;">'. theme('links', $links).'</div>';
+    }
+   }
+
+  return $output;
+}
 ?>
