Index: includes/install.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.inc,v
retrieving revision 1.15
diff -u -F^f -r1.15 install.inc
--- includes/install.inc	18 Aug 2006 18:58:44 -0000	1.15
+++ includes/install.inc	21 Aug 2006 06:19:44 -0000
@@ -349,6 +349,21 @@ function drupal_install_module($module) 
 }
 
 /**
+ * Calls the uninstall function and updates the system table for a given module.
+ *
+ * @param module
+ *   The module to install.
+ */
+function drupal_uninstall_module($module, $confirm = false) {
+  module_load_install($module);
+  $retval = module_invoke($module, 'uninstall', $confirm);
+  if ($confirm || !$retval) {
+    drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED);
+  }
+  return $retval;
+}
+
+/**
  * Verify the state of the specified file.
  *
  * @param $file
Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.82
diff -u -F^f -r1.82 module.inc
--- includes/module.inc	20 Aug 2006 05:57:40 -0000	1.82
+++ includes/module.inc	21 Aug 2006 06:19:45 -0000
@@ -103,9 +103,8 @@ function module_rebuild_cache() {
   ksort($files);
 
   foreach ($files as $filename => $file) {
-    drupal_get_filename('module', $file->name, $file->filename);
-    drupal_load('module', $file->name);
-
+    $file->metadata = module_get_meta_info($file->name, dirname($file->filename));
+    $files[$filename]->metadata = $file->metadata;
     // log the critical hooks implemented by this module
     $bootstrap = 0;
     foreach (bootstrap_hooks() as $hook) {
@@ -117,17 +116,93 @@ function module_rebuild_cache() {
 
     // Update the contents of the system table:
     if (isset($file->status) || (isset($file->old_filename) && $file->old_filename != $file->filename)) {
-      db_query("UPDATE {system} SET description = '%s', name = '%s', filename = '%s', bootstrap = %d WHERE filename = '%s'", $file->description, $file->name, $file->filename, $bootstrap, $file->old_filename);
+      db_query("UPDATE {system} SET description = '%s', name = '%s', filename = '%s', bootstrap = %d WHERE filename = '%s'", $file->metadata['description'], $file->name, $file->filename, $bootstrap, $file->old_filename);
     }
     else {
       // This is a new module.
-      db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $file->name, $file->description, 'module', $file->filename, $file->status, $file->throttle, $bootstrap);
+      db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $file->name, $file->metadata['description'], 'module', $file->filename, $file->status, $file->throttle, $bootstrap);
     }
   }
 
   return $files;
 }
+/**
+ * Parse drupal meta file format.
+ *
+ * @param $filename 
+ *   The path to the filename
+ * @return 
+ *   The meta data array
+ */
+function module_parse_meta_file($filename) {
+  $handle = fopen($filename, "r");
+  $meta = fread($handle, filesize($filename));
+  fclose($handle);
+  $metadata = array();    
+  $pattern = '@^\s*((?:[^:/]|/(?!/))+?)\s*:\s*(?:("(?:[^"]|(?<=\\\\)")*")|(\'(?:[^\']|(?<=\\\\)\')*\')|([^\n]*?))\s*($|//)@ms';    
+  if (preg_match_all($pattern, $meta, $matches, PREG_SET_ORDER)) {
+    foreach ($matches as $match) {
+      list(, $key, $value1, $value2, $value3) = $match;
+      $value = stripslashes(trim($value1, '"')) . stripslashes(trim($value2, "'")) . $value3;
+      $metadata[$key] = $value;
+    }
+  } 
+  return $metadata;
+}
+  
+/**
+ * Load the metadata associated with a module.
+ *
+ * @param $module
+ *   The name of the module
+ * @param $path
+ *   The path the module lives in, not including the module name.
+ */
+function module_get_meta_info($module, $path) {
+  $filename = $path .'/'. $module .'.meta';
+  $metadata = array();
+  
+  if (file_exists($filename)) {
+    $metadata = module_parse_meta_file($filename);
+  }
 
+  // Fill in a bunch of safe defaults.
+  if (!$metadata['package']) {
+    $metadata['package'] = t('Uncategorized');
+  }
+  if (!$metadata['version']) {
+    $metadata['version'] = t('unknown');
+  }
+  if ($metadata['version'] == 'SYSTEM') {
+    $metadata['version'] = VERSION;
+  }
+  if (!$metadata['drupal']) {
+    $metadata['drupal'] = t('undefined');
+  }
+  if (!$metadata['name']) {
+    $metadata['name'] = $module;
+  }
+  if (!$metadata['links']) {
+    $metadata['links'] = array();
+  }
+  else {
+    $metadata['links'] = explode(",", $metadata['links']);
+    $links = array();
+    foreach ($metadata['links'] as $link) {
+      list($link, $destination) = explode('=', $link, 2);
+      $links[] = array('title' => trim($link), 'href' => trim($destination));
+    }
+    $metadata['links'] = $links;
+  }
+  if ($metadata['dependencies']) {
+    $metadata['dependencies'] = explode(',', $metadata['dependencies']);
+  }
+  else {
+    $metadata['dependencies'] = array();
+  }
+  return $metadata;
+}
+ 
 /**
  * Determine whether a given module exists.
  *
Index: modules/aggregator/aggregator.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.install,v
retrieving revision 1.5
diff -u -F^f -r1.5 aggregator.install
--- modules/aggregator/aggregator.install	20 Aug 2006 06:38:50 -0000	1.5
+++ modules/aggregator/aggregator.install	21 Aug 2006 06:19:45 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: aggregator.install,v 1.5 2006/08/20 06:38:50 dries Exp $
 
+/**
+ * Implementation of hook_install.
+ * Create module tables.
+ */
 function aggregator_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -110,3 +114,25 @@ function aggregator_install() {
       break;
   }
 }
+
+/**
+ * Implementation of hook_uninstall.
+ * Delete all module variables and drop tables.
+ * @param $confirm user confirmation before uninstall.
+ * @return Confirmation message on before confirmation.
+ */
+function aggregator_uninstall($confirm = false) {
+  if (!$confirm) {
+    return t('All aggregator feeds will be deleted.');
+  }
+  db_query("DROP TABLE {aggregator_category}");
+  db_query("DROP TABLE {aggregator_category_feed}");
+  db_query("DROP TABLE {aggregator_category_item}");
+  db_query("DROP TABLE {aggregator_feed}");
+  db_query("DROP TABLE {aggregator_item}");
+  variable_del('aggregator_allowed_html_tags');
+  variable_del('aggregator_summary_items');
+  variable_del('aggregator_clear');
+  variable_del('aggregator_category_selector');
+}
+
Index: modules/aggregator/aggregator.meta
===================================================================
RCS file: modules/aggregator/aggregator.meta
diff -N modules/aggregator/aggregator.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/aggregator/aggregator.meta	21 Aug 2006 06:19:45 -0000
@@ -0,0 +1,6 @@
+name: Aggregator
+description:Aggregates syndicated content (RSS, RDF, and Atom feeds).
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/content/aggregator
Index: modules/block/block.meta
===================================================================
RCS file: modules/block/block.meta
diff -N modules/block/block.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/block/block.meta	21 Aug 2006 06:19:45 -0000
@@ -0,0 +1,6 @@
+name: Block
+description: Controls the boxes that are displayed around the main content.
+package: Required modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/build/block
Index: modules/blog/blog.meta
===================================================================
RCS file: modules/blog/blog.meta
diff -N modules/blog/blog.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/blog/blog.meta	21 Aug 2006 06:19:45 -0000
@@ -0,0 +1,6 @@
+name: Blog
+description: Enables keeping an easily and regularly updated web page or a blog.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: content type =  admin/content/types/blog
\ No newline at end of file
Index: modules/blogapi/blogapi.meta
===================================================================
RCS file: modules/blogapi/blogapi.meta
diff -N modules/blogapi/blogapi.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/blogapi/blogapi.meta	21 Aug 2006 06:19:45 -0000
@@ -0,0 +1,6 @@
+name: Blog API
+description: Allows users to post content using applications that support XML-RPC blog APIs.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: settings = admin/settings/blogapi
Index: modules/book/book.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.install,v
retrieving revision 1.5
diff -u -F^f -r1.5 book.install
--- modules/book/book.install	20 Aug 2006 06:38:50 -0000	1.5
+++ modules/book/book.install	21 Aug 2006 06:19:45 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: book.install,v 1.5 2006/08/20 06:38:50 dries Exp $
 
+/**
+ * Implementation of hook_install.
+ * Create module tables.
+ */
 function book_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -28,3 +32,17 @@ function book_install() {
       break;
   }
 }
+
+/**
+ * Implementation of hook_uninstall.
+ * Delete all module variables and drop tables.
+ * @param $confirm user confirmation before uninstall.
+ * @return Confirmation message on before confirmation.
+ */
+function book_uninstall($confirm = false) {
+  if (!$confirm) {
+    return t('All books will be deleted.');
+  }
+  db_query("DROP TABLE {book}");
+}
+
Index: modules/book/book.meta
===================================================================
RCS file: modules/book/book.meta
diff -N modules/book/book.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/book/book.meta	21 Aug 2006 06:19:45 -0000
@@ -0,0 +1,6 @@
+name: Book
+description: Allows users to collaboratively author a book.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/content/book, content type =  admin/content/types/book
Index: modules/comment/comment.meta
===================================================================
RCS file: modules/comment/comment.meta
diff -N modules/comment/comment.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/comment/comment.meta	21 Aug 2006 06:19:45 -0000
@@ -0,0 +1,6 @@
+name: Comment
+description: Allows users to comment on and discuss published content.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/content/comment
Index: modules/contact/contact.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.install,v
retrieving revision 1.4
diff -u -F^f -r1.4 contact.install
--- modules/contact/contact.install	20 Aug 2006 06:38:50 -0000	1.4
+++ modules/contact/contact.install	21 Aug 2006 06:19:46 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: contact.install,v 1.4 2006/08/20 06:38:50 dries Exp $
 
+/**
+ * Implementation of hook_install.
+ * Create module tables.
+ */
 function contact_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -30,3 +34,19 @@ function contact_install() {
       break;
   }
 }
+
+/**
+ * Implementation of hook_uninstall.
+ * Delete all module variables and drop tables.
+ * @param $confirm user confirmation before uninstall.
+ * @return Confirmation message on before confirmation.
+ */
+function contact_uninstall($confirm = false) {
+  if (!$confirm) {
+    return t('All contact information will be deleted.');
+  }
+  db_query("DROP TABLE {contact}");
+  variable_del('contact_default_status');
+  variable_del('contact_form_information');
+  variable_del('contact_hourly_threshold');
+}
Index: modules/contact/contact.meta
===================================================================
RCS file: modules/contact/contact.meta
diff -N modules/contact/contact.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/contact/contact.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,6 @@
+name: Contact
+description: Enables the use of both personal and site-wide contact forms.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/build/contact
Index: modules/drupal/drupal.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/drupal/drupal.install,v
retrieving revision 1.4
diff -u -F^f -r1.4 drupal.install
--- modules/drupal/drupal.install	20 Aug 2006 06:38:50 -0000	1.4
+++ modules/drupal/drupal.install	21 Aug 2006 06:19:46 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: drupal.install,v 1.4 2006/08/20 06:38:50 dries Exp $
 
+/**
+ * Implementation of hook_install.
+ * Create module tables.
+ */
 function drupal_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -52,3 +56,27 @@ function drupal_install() {
       break;
   }
 }
+
+/**
+ * Implementation of hook_uninstall.
+ * Delete all module variables and drop tables.
+ * @param $confirm user confirmation before uninstall.
+ * @return Confirmation message on before confirmation.
+ */
+function drupal_uninstall($confirm = false) {
+  if (!$confirm) {
+    return t('All drupal client information will be deleted.');
+  }
+  db_query("DROP TABLE {client}");
+  db_query("DROP TABLE {client_system}");
+  variable_del('drupal_authentication_service');
+  variable_del('drupal_directory');
+  variable_del('drupal_register');
+  variable_del('drupal_server');
+  variable_del('drupal_system');
+  variable_del('drupal_statistics');
+  variable_del('drupal_client_service');
+  variable_del('drupal_default_da_server');
+  variable_del('drupal_default_da_server_only');
+}
+
Index: modules/drupal/drupal.meta
===================================================================
RCS file: modules/drupal/drupal.meta
diff -N modules/drupal/drupal.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/drupal/drupal.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,6 @@
+name: Drupal
+description: Lets you register your site with a central server and improve ranking of Drupal projects by posting information on your installed modules and themes; also enables users to log in using a Drupal ID.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: sites registry = admin/settings/sites-registry, authentication = admin/settings/distributed-authentication
Index: modules/filter/filter.meta
===================================================================
RCS file: modules/filter/filter.meta
diff -N modules/filter/filter.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/filter/filter.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,6 @@
+name: Filter
+description: Handles the filtering of content in preparation for display.
+package: Required modules
+version: SYSTEM
+drupal: 4.8
+links: settings = admin/settings/filters
Index: modules/forum/forum.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.install,v
retrieving revision 1.5
diff -u -F^f -r1.5 forum.install
--- modules/forum/forum.install	20 Aug 2006 06:38:50 -0000	1.5
+++ modules/forum/forum.install	21 Aug 2006 06:19:46 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: forum.install,v 1.5 2006/08/20 06:38:50 dries Exp $
 
+/**
+ * Implementation of hook_install.
+ * Create module tables.
+ */
 function forum_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -26,3 +30,24 @@ function forum_install() {
       break;
   }
 }
+
+/**
+ * Implementation of hook_uninstall.
+ * Delete all module variables and drop tables.
+ * @param $confirm user confirmation before uninstall.
+ * @return Confirmation message on before confirmation.
+ */
+function forum_uninstall($confirm = false) {
+  if (!$confirm) {
+    return t('All your forums and forum posts will be deleted.');
+  }
+  db_query("DROP TABLE {forum}");
+  db_query("DELETE FROM {node} WHERE type = 'forum'");
+  variable_del('forum_containers');
+  variable_del('forum_nav_vocabulary');
+  variable_del('forum_hot_topic');
+  variable_del('forum_per_page');
+  variable_del('forum_order');
+  variable_del('forum_block_num_0');
+  variable_del('forum_block_num_1');
+}
Index: modules/forum/forum.meta
===================================================================
RCS file: modules/forum/forum.meta
diff -N modules/forum/forum.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/forum/forum.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,6 @@
+name: Forum
+description: Enables threaded discussions about general topics.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/content/forum, content type =  admin/content/types/forum
Index: modules/help/help.meta
===================================================================
RCS file: modules/help/help.meta
diff -N modules/help/help.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/help/help.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,6 @@
+name: Help
+description: Manages the display of online help.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: view help = admin/help
Index: modules/legacy/legacy.meta
===================================================================
RCS file: modules/legacy/legacy.meta
diff -N modules/legacy/legacy.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/legacy/legacy.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,5 @@
+name: Legacy
+description: Provides legacy handlers for upgrades from older Drupal installations.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
Index: modules/locale/locale.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v
retrieving revision 1.4
diff -u -F^f -r1.4 locale.install
--- modules/locale/locale.install	20 Aug 2006 06:38:50 -0000	1.4
+++ modules/locale/locale.install	21 Aug 2006 06:19:46 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: locale.install,v 1.4 2006/08/20 06:38:50 dries Exp $
 
+/**
+ * Implementation of hook_install.
+ * Create module tables.
+ */
 function locale_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -67,3 +71,19 @@ function locale_install() {
   }
   db_query("INSERT INTO {locales_meta} (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1')");
 }
+
+/**
+ * Implementation of hook_uninstall.
+ * Delete all module variables and drop tables.
+ * @param $confirm user confirmation before uninstall.
+ * @return Confirmation message on before confirmation.
+ */
+function locale_uninstall($confirm = false) {
+  if (!$confirm) {
+    return t('All locale information will be deleted.');
+  }
+  db_query("DROP TABLE {locales_meta}");
+  db_query("DROP TABLE {locales_source}");
+  db_query("DROP TABLE {locales_target}");
+}
+
Index: modules/locale/locale.meta
===================================================================
RCS file: modules/locale/locale.meta
diff -N modules/locale/locale.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/locale/locale.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,6 @@
+name: Locale
+description: Enables the translation of the user interface to languages other than English.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/settings/locale
\ No newline at end of file
Index: modules/menu/menu.meta
===================================================================
RCS file: modules/menu/menu.meta
diff -N modules/menu/menu.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/menu/menu.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,6 @@
+name: Menu
+description: Allows administrators to customize the site navigation menu.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/build/menu
\ No newline at end of file
Index: modules/node/node.meta
===================================================================
RCS file: modules/node/node.meta
diff -N modules/node/node.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/node/node.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,6 @@
+name: Node
+description: Allows content to be submitted to the site and displayed on pages.
+package: Required modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/content/node, settings = admin/content/node-settings, content types = admin/content/types
Index: modules/path/path.meta
===================================================================
RCS file: modules/path/path.meta
diff -N modules/path/path.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/path/path.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,6 @@
+name: Path
+description: Allows users to rename URLs.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/build/path
Index: modules/ping/ping.meta
===================================================================
RCS file: modules/ping/ping.meta
diff -N modules/ping/ping.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/ping/ping.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,5 @@
+name: Ping
+description: Alerts other sites when your site has been updated.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
Index: modules/poll/poll.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.install,v
retrieving revision 1.6
diff -u -F^f -r1.6 poll.install
--- modules/poll/poll.install	20 Aug 2006 06:38:50 -0000	1.6
+++ modules/poll/poll.install	21 Aug 2006 06:19:46 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: poll.install,v 1.6 2006/08/20 06:38:50 dries Exp $
 
+/**
+ * Implementation of hook_install.
+ * Create module tables.
+ */
 function poll_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -63,3 +67,18 @@ function poll_install() {
       break;
   }
 }
+
+/**
+ * Implementation of hook_uninstall.
+ * Delete all module variables and drop tables.
+ * @param $confirm user confirmation before uninstall.
+ * @return Confirmation message on before confirmation.
+ */
+function poll_uninstall($confirm = false) {
+  if (!$confirm) {
+    return t('All configured pols and votes will be deleted.');
+  }
+  db_query("DROP TABLE {poll}");
+  db_query("DROP TABLE {poll_votes}");
+  db_query("DROP TABLE {poll_choices}");
+}
Index: modules/poll/poll.meta
===================================================================
RCS file: modules/poll/poll.meta
diff -N modules/poll/poll.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/poll/poll.meta	21 Aug 2006 06:19:46 -0000
@@ -0,0 +1,6 @@
+name: Poll
+description: Allows your site to capture votes on different topics in the form of multiple choice questions.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: content type =  admin/content/types/poll
\ No newline at end of file
Index: modules/profile/profile.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.install,v
retrieving revision 1.6
diff -u -F^f -r1.6 profile.install
--- modules/profile/profile.install	20 Aug 2006 06:38:50 -0000	1.6
+++ modules/profile/profile.install	21 Aug 2006 06:19:47 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: profile.install,v 1.6 2006/08/20 06:38:50 dries Exp $
 
+/**
+ * Implementation of hook_install.
+ * Create module tables.
+ */
 function profile_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -63,3 +67,18 @@ function profile_install() {
       break;
   }
 }
+
+/**
+ * Implementation of hook_uninstall.
+ * Delete all module variables and drop tables.
+ * @param $confirm user confirmation before uninstall.
+ * @return Confirmation message on before confirmation.
+ */
+function profile_uninstall($confirm = false) {
+  if (!$confirm) {
+    return t('All configure user profiles will be deleted.');
+  }
+  db_query("DROP TABLE {profile_fields}");
+  db_query("DROP TABLE {profile_values}");
+  variable_del('profile_block_author_fields');
+}
Index: modules/profile/profile.meta
===================================================================
RCS file: modules/profile/profile.meta
diff -N modules/profile/profile.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/profile/profile.meta	21 Aug 2006 06:19:47 -0000
@@ -0,0 +1,6 @@
+name: Profile
+description: Supports configurable user profiles.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/user/profile
Index: modules/search/search.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.install,v
retrieving revision 1.5
diff -u -F^f -r1.5 search.install
--- modules/search/search.install	20 Aug 2006 06:38:50 -0000	1.5
+++ modules/search/search.install	21 Aug 2006 06:19:47 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: search.install,v 1.5 2006/08/20 06:38:50 dries Exp $
 
+/**
+ * Implementation of hook_install.
+ * Create module tables.
+ */
 function search_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -58,3 +62,20 @@ function search_install() {
       break;
   }
 }
+
+/**
+ * Implementation of hook_uninstall.
+ * Delete all module variables and drop tables.
+ * @param $confirm user confirmation before uninstall.
+ * @return Confirmation message on before confirmation.
+ */
+function search_uninstall($confirm = false) {
+  if (!$confirm) {
+    return t('All indexes will be deleted.');
+  }
+  db_query("DROP TABLE {search_dataset}");
+  db_query("DROP TABLE {search_index}");
+  db_query("DROP TABLE {search_total}");
+  variable_del('minimum_word_size');
+  variable_del('overlap_cjk');
+}
Index: modules/search/search.meta
===================================================================
RCS file: modules/search/search.meta
diff -N modules/search/search.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/search/search.meta	21 Aug 2006 06:19:47 -0000
@@ -0,0 +1,6 @@
+name: Search
+description: Enables site-wide keyword searching.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: settings = admin/settings/search
Index: modules/statistics/statistics.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.install,v
retrieving revision 1.5
diff -u -F^f -r1.5 statistics.install
--- modules/statistics/statistics.install	20 Aug 2006 06:38:50 -0000	1.5
+++ modules/statistics/statistics.install	21 Aug 2006 06:19:47 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: statistics.install,v 1.5 2006/08/20 06:38:50 dries Exp $
 
+/**
+ * Implementation of hook_install.
+ * Create module tables.
+ */
 function statistics_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -36,3 +40,23 @@ function statistics_install() {
       break;
   }
 }
+
+/**
+ * Implementation of hook_uninstall.
+ * Delete all module variables and drop tables.
+ * @param $confirm user confirmation before uninstall.
+ * @return Confirmation message on before confirmation.
+ */
+function statistics_uninstall($confirm = false) {
+  if (!$confirm) {
+    return t('All site statistics will be deleted.');
+  }
+  db_query("DROP TABLE {accesslog}");
+  variable_del('statistics_count_content_views');
+  variable_del('statistics_enable_access_log');
+  variable_del('statistics_flush_accesslog_timer');
+  variable_del('statistics_day_timestamp');
+  variable_del('statistics_block_top_day_num');
+  variable_del('statistics_block_top_all_num');
+  variable_del('statistics_block_top_last_num');
+}
Index: modules/statistics/statistics.meta
===================================================================
RCS file: modules/statistics/statistics.meta
diff -N modules/statistics/statistics.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/statistics/statistics.meta	21 Aug 2006 06:19:47 -0000
@@ -0,0 +1,6 @@
+name: Statistics
+description: Logs access statistics for your site.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: settings = admin/logs/settings
\ No newline at end of file
Index: modules/system/admin.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/admin.css,v
retrieving revision 1.2
diff -u -F^f -r1.2 admin.css
--- modules/system/admin.css	17 Aug 2006 21:39:47 -0000	1.2
+++ modules/system/admin.css	21 Aug 2006 06:19:47 -0000
@@ -49,3 +49,62 @@
   margin-right: 1em;
   padding-right: 4px;
 }
+
+
+/*
+** Formatting for modules page
+*/
+
+table.modules-table {
+  width: 100%;
+}
+
+th.modules-header {
+  font-size: 140%;
+  border: none;
+  background-color: white;
+  padding: 1em 0 0.5em 0;
+}
+
+th.modules-heading {
+  font-size: 110%;
+  padding:0.2em 0 0.2em 0.5em;
+}
+
+table.modules-table tr.odd td, table.modules-table tr.even td {
+  padding: 0.5em 0 0.5em 0.5em;
+  vertical-align: top;
+}
+
+table.modules-table p {
+  margin: 0;
+  font-size: 90%;
+}
+
+table.modules-table p.required { 
+  color: #ff0000;
+  font-style: italic;
+  padding-top: 0.25em;
+}
+
+input.modules-button {
+  cursor: pointer;
+  font-size:95%;
+}
+
+ul.modules-links {
+  margin: 0 0 0.5em 0;
+  padding: 0;
+  list-style: none;
+}
+
+ul.modules-links li {
+  display: inline;
+  padding:0 1em;
+  border-left: 1px solid #ccc;
+}
+
+ul.modules-links li.first {
+  border: none;
+  padding-left: 0;
+}
Index: modules/system/system.meta
===================================================================
RCS file: modules/system/system.meta
diff -N modules/system/system.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/system/system.meta	21 Aug 2006 06:19:47 -0000
@@ -0,0 +1,5 @@
+name: System
+description: Handles general site configuration for administrators.
+package: Required modules
+version: SYSTEM
+drupal: 4.8
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.348
diff -u -F^f -r1.348 system.module
--- modules/system/system.module	20 Aug 2006 05:57:40 -0000	1.348
+++ modules/system/system.module	21 Aug 2006 06:19:52 -0000
@@ -43,8 +43,10 @@ function system_help($section) {
       $theme = array_pop($reference);
       return t('<p>These options control the display settings for the <code>%template</code> theme. When your site is displayed using this theme, these settings will be used. By clicking "Reset to defaults," you can choose to use the <a href="@global">global settings</a> for this theme.</p>', array('%template' => $theme, '@global' => url('admin/build/themes/settings')));
     case 'admin/settings/modules':
-      return t('<p>Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Click on the name of the module in the navigation menu for their individual configuration pages. Once a module is enabled, new <a href="@permissions">permissions</a> might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by enabling the throttle.module and checking throttle. The auto-throttle functionality must be enabled on the <a href="@throttle">throttle configuration page</a> after having enabled the throttle module.</p>
-<p>It is important that <a href="@update-php">update.php</a> is run every time a module is updated to a newer version.</p>', array('@permissions' => url('admin/user/access'), '@throttle' => url('admin/settings/throttle'), '@update-php' => $base_url .'/update.php'));
+      return t('<p>Modules are plugins for Drupal that extend its core functionality. Here you can see which modules are enabled. Some modules may include links to their administration pages. Once a module is enabled, new <a href="@permissions">permissions</a> might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by enabling the throttle.module and visiting the throttle administration pages.</p><p>If a module is required by another module that is enabled, you will not be able to disable that module until all modules that require it are disabled.</p>
+<p>It is important that <a href="@update-php">update.php</a> is run every time a module is updated to a newer version.</p>', array('@permissions' => url('admin/user/access'), '@update-php' => $base_url .'/update.php'));
+    case 'admin/settings/modules/disabled':
+      return t('<p>Modules are plugins for Drupal that extend its core functionality. Here you can install new modules or re-enable/uninstall previously disabled modules. Once a module is enabled, new <a href="@permissions">permissions</a> might be made available.</p><p><strong>Note that uninstalling a module will remove that module\'s data from your system, and that this operation is not recoverable!</strong> If you are not sure, be sure to make a backup of your database before selecting uninstall!</p><p>If a module is required by another module, you will not be able to enable that module until all modules that it requires are enabled.</p>', array('@permissions' => url('admin/user/access')));
   }
 }
 
@@ -185,9 +187,28 @@ function system_menu($may_cache) {
       'title' => t('modules'),
       'description' => t('Enable or disable add-on modules for your site.'),
       'weight' => -10,
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('system_modules'),
+      'callback' => 'system_modules',
+      'callback arguments' => array('enabled'),
       'access' => $access);
+    $items[] = array('path' => 'admin/settings/modules/enabled', 
+      'title' => t('enabled'),
+      'callback' => 'system_modules', 
+      'callback arguments' => array('enabled'), 
+      'access' => $access, 
+      'type' => MENU_DEFAULT_LOCAL_TASK, 
+      'weight' => -10);
+    $items[] = array('path' => 'admin/settings/modules/disabled',
+      'title' => t('disabled'),
+      'callback' => 'system_modules', 
+      'callback arguments' => array('disabled'), 
+      'access' => $access, 
+      'type' => MENU_LOCAL_TASK);    
+    $items[] = array('path' => 'admin/settings/modules/uninstall',
+      'title' => t('confirm uninstall'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('system_confirm_uninstall'), 
+      'access' => $access, 
+      'type' => MENU_CALLBACK);    
 
     // Settings:
     $items[] = array(
@@ -1199,115 +1220,294 @@ function system_themes_submit($form_id, 
 }
 
 /**
+ * Helper function to reduce code. Provides a form that is a button or two
+ * keyed to the module.
+ */
+function system_module_form($module, $metadata, $type, $type2 = NULL) {
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => $type,
+    '#attributes' => array('class' => 'modules-button')
+  );
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => $type,
+    '#attributes' => array('class' => 'modules-button')
+  );
+  
+  $form['metadata'] = array(
+    '#type' => 'value',
+    '#value' => $metadata,
+    '#attributes' => array('class' => 'modules-button')
+  );
+  
+  $form['#submit']['system_module_form_submit'] = array();
+
+  if ($type2) {
+    $form['submit2'] = array(
+      '#type' => 'submit',
+      '#value' => $type2,
+      '#attributes' => array('class' => 'modules-button')
+    );
+  }
+  return $form;
+}
+
+function system_forms() {
+  static $forms = array();
+  if (!$forms) {
+    $files = system_listing('\.module$', 'modules', 'name', 0);
+    foreach ($files as $file) {
+      $forms["system_module_form_$file->name"]['callback'] = 'system_module_form';
+    }
+  }
+  return $forms;
+
+}
+
+/**
  * Menu callback; displays a listing of all modules.
  */
-function system_modules() {
+function system_modules($type) {
   // Get current list of modules
   $files = module_rebuild_cache();
+  $required = array('block', 'filter', 'node', 'system', 'user', 'watchdog');
 
   foreach ($files as $filename => $file) {
-    drupal_get_filename('module', $file->name, $file->filename);
-    drupal_load('module', $file->name);
-
-    $file->description = module_invoke($file->name, 'help', 'admin/settings/modules#description');
+    $metadata = $file->metadata;
+    if (($type == 'enabled' && $file->status) || ($type == 'disabled' && !$file->status)) {
+      $packages[$metadata['package']][] = $file->name;
+      $options[$file->name] = '';
+    }
 
-    $form['name'][$file->name] = array('#value' => $file->name);
-    $form['description'][$file->name] = array('#value' => $file->description);
-    $options[$file->name] = '';
+    $file->description = $metadata['description'];
+ 
+    // for later dependency checking.
     if ($file->status) {
-      $status[] = $file->name;
+      $metadata['enabled'] = true;
     }
-    if ($file->throttle) {
-      $throttle[] = $file->name;
+    else if ($file->schema_version != -1) {
+      $metadata['uninstalled'] = true;
     }
+    $metadata['filename'] = $file->filename;
+    $modules[$filename] = $metadata;
   }
 
-  // Handle status checkboxes, including overriding the generated
-  // checkboxes for required modules.
-  $form['status'] = array('#type' => 'checkboxes', '#default_value' => $status, '#options' => $options);
-  $required = array('block', 'filter', 'node', 'system', 'user', 'watchdog');
-  foreach ($required as $require) {
-    $form['status'][$require] = array('#type' => 'hidden', '#value' => 1, '#suffix' => t('required'));
+  if (!$packages) {
+    return t('<p>There are currently no modules that you can enable.</p>');
   }
 
-  /**
-   * Handle throttle checkboxes, including overriding the generated checkboxes for required modules.
-   */
-  if (module_exists('throttle')) {
-    $form['throttle'] = array('#type' => 'checkboxes', '#default_value' => $throttle, '#options' => $options);
-    $throttle_required = array_merge($required, array('throttle'));
-    foreach ($throttle_required as $require) {
-      $form['throttle'][$require] = array('#type' => 'hidden', '#value' => 0, '#suffix' => t('required'));
+  $top_array = array();
+  // Re-order packages to force core modules to the top.
+  foreach (array(t('Required modules'), t('Drupal core modules')) as $key) {
+    if (is_array($packages[$key])) { 
+      $top_array[$key] = $packages[$key];
+      unset($packages[$key]);
     }
   }
 
-  $form['buttons']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
+  ksort($packages);
+  $packages = array_merge($top_array, $packages);
 
-  return $form;
-}
+  $header = array(
+    array('data' => t('Name')       , 'header' => TRUE, 'class' => 'modules-heading'),
+    array('data' => t('Version')    , 'header' => TRUE, 'class' => 'modules-heading'),
+    array('data' => t('Related Links & Description'), 'header' => TRUE, 'class' => 'modules-heading'),
+    array('data' => t('Operations') , 'header' => TRUE, 'class' => 'modules-heading', 'colspan' => 2),
+  );
+       
+  $rows = array();
+  foreach ($packages as $group => $package) {
+    $rows[] = array(
+      array(
+        'colspan' => 5,
+        'header'  => TRUE,
+        'data' => $group,
+        'class' => 'modules-header', 
+      )
+    );
+    $rows[] = $header;
+    foreach ($package as $module) {
+      $modules[$module]['buttons'] = array();
+    
+      // Check for dependencies.
+      $depends = '';
+      $can_change = TRUE;
+      $compatible = strpos(VERSION, $modules[$module]['drupal']) === 0;
+          
+      if (!$modules[$module]['enabled']) {
+        // disabled modules and don't get their links
+        $modules[$module]['links'] = array();
+        foreach ($modules[$module]['dependencies'] as $dependency) {
+          $depends .= (!$depends ? t('Depends on: ') : ', ') ."<em>$dependency</em>";
+          if (!$modules[$dependency]['enabled']) {
+            $depends .= t(' (not present)');
+            $can_change = FALSE;
+          }
+        }
+        if ($can_change&&$compatible) {
+          if ($modules[$module]['uninstalled']) {
+            $modules[$module]['buttons'][] = drupal_get_form("system_module_form_$module", $module, $modules[$module], t('Enable'), t('Uninstall'));
+          } 
+          else {
+            $modules[$module]['buttons'][] = drupal_get_form("system_module_form_$module", $module, $modules[$module], t('Install'));  
+          }
+        }
+        else {
+          if ($modules[$module]['uninstalled']) {
+            $modules[$module]['buttons'][] = drupal_get_form("system_module_form_$module", $module, $modules[$module], t('Uninstall'));
+          } 
+        }
+      }
+      else {
+        // Check for modules that depend on this module.
+        foreach ($modules as $dependency => $module_data) {
+          if (in_array($module, $module_data['dependencies']) && $module_data['enabled']) {
+            $depends .= (!$depends ? t('Required by: ') : ', ') ."<em>$dependency</em>";
+            $can_change = FALSE;
+          }
+        }
+        if ($can_change && !in_array($module, $required)) {
+          $modules[$module]['buttons'][] = drupal_get_form("system_module_form_$module", $module, $modules[$module], t('Disable'));
+        }
+      }
+      $cells = array();
+      $cells[] = $modules[$module]['name'];
+      $cells[] = $modules[$module]['version'];
+      $description = theme('system_module_links', $modules[$module]['links']) . '<p class="modules-description">' . $modules[$module]['description'] . '</p>';
+      if ($depends) {
+        $description .= '<p class="required">' . $depends . '</p>';
+      }
+      $cells[] = $description;
+
+      if ($help = module_invoke($module, 'help', "admin/help#$module")) {
+        $modules[$module]['links'][] = array('title' => t('help'), 'href' => "admin/help/$module");
+      }
+      if ($perms = module_invoke($module, 'perm')) {
+        $modules[$module]['links'][] = array('title' => t('permissions'), 'href' => 'admin/user/access', 'fragment' => "module-$module");
+      }
+
+//      $cells[] = array(
+//        'data' => theme('links', $modules[$module]['links']),
+//        'class' => 'modules-links',
+//      );
+
+//      if ($modules[$module]['buttons']) {
+        $cells[] = array(
+          'data' => implode(' ', $modules[$module]['buttons']),
+          'nowrap' => TRUE,
+          'class' => 'modules-buttons',
+        );
+//      }
+//      else {
+//        $cells[3]['colspan'] = 2;
+//      }
+      $rows[] = $cells;
+      if (!$compatible) {
+        $rows[] = array('', array(
+          'data' => t('(This module is for Drupal version %version and not compatible with your current version)', array('%version' => $modules[$module]['drupal'])), 
+          'colspan' => 4)
+        );
+      }
+    }
+  }
 
-function theme_system_modules($form) {
-  foreach (element_children($form['name']) as $key) {
-    $row = array();
-    $row[] = drupal_render($form['name'][$key]);
-    $row[] = drupal_render($form['description'][$key]);
-    $row[] = array('data' => drupal_render($form['status'][$key]), 'align' => 'center');
+  if ($rows) {
+    $output .= theme('table', array(), $rows , array('class' => 'modules-table'));
+  }  
 
-    if (module_exists('throttle')) {
-      $row[] = array('data' => drupal_render($form['throttle'][$key]), 'align' => 'center');
+  return $output;
+}
+
+function theme_system_module_links($links) {
+  $output = '';
+  
+  if ($links) {
+    $l = array();
+    
+    foreach ($links as $link) {
+      $l[] = l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment']);
     }
-    $rows[] = $row;
-  }
+    
+    $output = '<ul class="modules-links"><li class="first">'. implode('</li><li>', $l) .'</li></ul>';
 
-  $header = array(t('Name'), t('Description'), t('Enabled'));
-  if (module_exists('throttle')) {
-    $header[] = t('Throttle');
   }
 
-  $output = theme('table', $header, $rows);
-  $output .= drupal_render($form);
   return $output;
 }
 
-
-function system_modules_submit($form_id, $edit) {
+/**
+ * Implementation of the module form hook_submit().
+ * @param $form_id
+ *  The id of the form.
+ * @param $form_values
+ *  The values passed back from the client.
+ */
+function system_module_form_submit($form_id, $form_values) {
   include_once './includes/install.inc';
-  $new_modules = array();
-  foreach ($edit['status'] as $key => $choice) {
-    if ($choice) {
-      if (drupal_get_installed_schema_version($key) == SCHEMA_UNINSTALLED) {
-        $new_modules[] = $key;
-      }
-      else {
-        module_enable($key);
+  $module = str_replace('system_module_form_', '', $form_id);
+  $metadata = $form_values['metadata'];
+
+  $op = $_POST['op'];
+  if ($op == t('Install') || $op == t('Enable')) {
+    $status = 1;
+    if ($op == t('Install')) {
+      drupal_install_module($module);
+      drupal_set_message(t('%module installed.', array('%module' => $metadata['name'])));
+    } 
+    else {
+      module_enable($module);
+      drupal_set_message(t('%module enabled.', array('%module' => $metadata['name'])));
+    }
+  }
+  else {
+    $status = 0;
+    if ($op == t('Uninstall')) {
+      $confirm = drupal_uninstall_module($module);
+      if ($confirm) {
+        return "admin/settings/modules/uninstall/$module";
       }
+      drupal_set_message(t('%module uninstalled.', array('%module' => $metadata['name'])));
     }
     else {
-      module_disable($key);
+      module_disable($module);
+      drupal_set_message(t('%module disabled.', array('%module' => $metadata['name'])));
     }
   }
 
-  module_list(TRUE, FALSE);
+  menu_rebuild();
+  return $_GET['q'];
+}
 
-  foreach ($new_modules as $module) {
-    drupal_install_module($module);
+function system_confirm_uninstall($module = NULL) {
+  if (!$module) {
+    return drupal_not_found();
   }
+  include_once './includes/install.inc';
+  $message = drupal_uninstall_module($module);
 
-  if (is_array($edit['throttle'])) {
-    foreach ($edit['throttle'] as $key => $choice) {
-      if ($choice) {
-        db_query("UPDATE {system} SET throttle = 1 WHERE type = 'module' and name = '%s'", $key);
-      }
-    }
+  if (!$message) {
+    return drupal_goto('admin/settings/modules/disabled');
   }
 
-  menu_rebuild();
-  node_types_rebuild();
-
-  drupal_set_message(t('The configuration options have been saved.'));
-  return 'admin/settings/modules';
+  $form['module'] = array('#type' => 'value', '#value' => $module);
+  return confirm_form($form,
+    t('Are you sure you want to uninstall @module?', array('@module' => $module)),
+    $_GET['destination'] ? $_GET['destination'] : 'admin/settings/modules/disabled',
+    '<p>' . $message . '</p>',
+    t('Uninstall'), t('Cancel')
+  );
 }
 
+function system_confirm_uninstall_submit($form_id, $form) {
+  if ($form['confirm']) {
+    include_once './includes/install.inc';
+    drupal_uninstall_module($form['module'], true);
+    drupal_set_message(t('%module uninstalled.', array('%module' => $form['module'])));
+  }
+  return 'admin/settings/modules/disabled';
+}
 
 /**
  * Menu callback; displays a module's settings page.
Index: modules/taxonomy/taxonomy.meta
===================================================================
RCS file: modules/taxonomy/taxonomy.meta
diff -N modules/taxonomy/taxonomy.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/taxonomy/taxonomy.meta	21 Aug 2006 06:19:52 -0000
@@ -0,0 +1,6 @@
+name: Taxonomy
+description: Enables the categorization of content.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/content/taxonomy
Index: modules/throttle/throttle.meta
===================================================================
RCS file: modules/throttle/throttle.meta
diff -N modules/throttle/throttle.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/throttle/throttle.meta	21 Aug 2006 06:19:52 -0000
@@ -0,0 +1,6 @@
+name: Throttle
+description: Handles the auto-throttling mechanism, to control site congestion.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/settings/throttle
Index: modules/throttle/throttle.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/throttle/throttle.module,v
retrieving revision 1.65
diff -u -F^f -r1.65 throttle.module
--- modules/throttle/throttle.module	18 Aug 2006 18:58:46 -0000	1.65
+++ modules/throttle/throttle.module	21 Aug 2006 06:19:53 -0000
@@ -14,10 +14,26 @@ function throttle_menu($may_cache) {
       'path' => 'admin/settings/throttle',
       'description' => t('Control how your site cuts out content during heavy load.'),
       'title' => t('throttle'),
+      'access' => user_access('administer site configuration'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('throttle_admin_modules'),
+      'type' => MENU_NORMAL_ITEM,
+    );
+    $items[] = array(
+      'path' => 'admin/settings/throttle/modules',
+      'title' => t('modules'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('throttle_admin_modules'),
+      'access' => user_access('administer site configuration'),
+      'type' => MENU_DEFAULT_LOCAL_TASK,
+    );
+    $items[] = array(
+      'path' => 'admin/settings/throttle/settings',
+      'title' => t('settings'),
       'callback' => 'drupal_get_form',
       'callback arguments' => array('throttle_admin_settings'),
       'access' => user_access('administer site configuration'),
-      'type' => MENU_NORMAL_ITEM
+      'type' => MENU_LOCAL_TASK,
     );
   }
 
@@ -171,3 +187,65 @@ function throttle_admin_settings() {
 
   return system_settings_form($form);
 }
+
+function throttle_admin_modules() {
+  // Get current list of modules
+  $result = db_query("SELECT * FROM {system} WHERE type = 'module' AND status = 1");
+
+  $required = array('block', 'filter', 'node', 'system', 'user', 'watchdog', 'throttle');
+  while ($file = db_fetch_object($result)) {
+    if (!in_array($file->name, $required) && file_exists($file->filename)) {
+      $form['name'][$file->name] = array('#value' => $file->name);
+      $form['description'][$file->name] = array('#value' => $file->description);
+      $options[$file->name] = '';
+      $form['original'][$file->name] = array(
+        '#type' => 'value', 
+        '#value' => $file->throttle,
+      );
+      $form['original']['#tree'] = TRUE;
+      if ($file->throttle) {
+        $throttle[] = $file->name;
+      }
+    }
+  }
+
+  // Handle status checkboxes, including overriding the generated
+  // checkboxes for required modules.
+  $form['throttle'] = array('#type' => 'checkboxes', '#default_value' => $throttle, '#options' => $options);
+  foreach ($throttle_required as $require) {
+    $form['throttle'][$require] = array('#type' => 'hidden', '#value' => 0, '#suffix' => t('required'));
+  }
+
+  $form['buttons']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
+
+  return $form;
+}
+
+function theme_throttle_admin_modules($form) {
+  foreach (element_children($form['name']) as $key) {
+    $row = array();
+    $row[] = drupal_render($form['name'][$key]);
+    $row[] = drupal_render($form['description'][$key]);
+    $row[] = array('data' => drupal_render($form['throttle'][$key]), 'align' => 'center');
+    $rows[] = $row;
+  }
+
+  $header = array(t('Name'), t('Description'), t('Throttle'));
+
+  $output = theme('table', $header, $rows);
+  $output .= drupal_render($form);
+  return $output;
+}
+
+function throttle_admin_modules_submit($form_id, $edit) {
+  foreach ($edit['throttle'] as $key => $choice) {
+    if ($choice && !$edit['original'][$key]) {
+      db_query("UPDATE {system} SET throttle = 1 WHERE type = 'module' and name = '%s'", $key);
+    }
+    else if (!$choice && $edit['original'][$key]) {
+      db_query("UPDATE {system} SET throttle = 0 WHERE type = 'module' and name = '%s'", $key);
+    }
+  }
+  
+  drupal_set_message(t('The configuration has been saved.'));
+}
Index: modules/tracker/tracker.meta
===================================================================
RCS file: modules/tracker/tracker.meta
diff -N modules/tracker/tracker.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/tracker/tracker.meta	21 Aug 2006 06:19:53 -0000
@@ -0,0 +1,5 @@
+name: Tracker
+description: Enables tracking of recent posts for users.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
Index: modules/upload/upload.meta
===================================================================
RCS file: modules/upload/upload.meta
diff -N modules/upload/upload.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/upload/upload.meta	21 Aug 2006 06:19:53 -0000
@@ -0,0 +1,6 @@
+name: Upload
+description: Allows users to upload and attach files to content.
+package: Drupal core modules
+version: SYSTEM
+drupal: 4.8
+links: settings = admin/settings/uploads
Index: modules/user/user.meta
===================================================================
RCS file: modules/user/user.meta
diff -N modules/user/user.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/user/user.meta	21 Aug 2006 06:19:53 -0000
@@ -0,0 +1,7 @@
+name: User
+description: Manages the user registration and login system.
+package: Required modules
+version: SYSTEM
+drupal: 4.8
+links: administer = admin/user/user, settings=admin/user/settings
+
Index: modules/watchdog/watchdog.meta
===================================================================
RCS file: modules/watchdog/watchdog.meta
diff -N modules/watchdog/watchdog.meta
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/watchdog/watchdog.meta	21 Aug 2006 06:19:53 -0000
@@ -0,0 +1,6 @@
+name: Watchdog
+description: Logs and records system events.
+package: Required modules
+version: SYSTEM
+drupal: 4.8
+links: view logs = admin/logs/watchdog
