Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.20
diff -u -F^f -r1.20 system.admin.inc
--- modules/system/system.admin.inc	4 Nov 2007 15:54:53 -0000	1.20
+++ modules/system/system.admin.inc	7 Nov 2007 17:07:15 -0000
@@ -108,6 +108,11 @@ function system_admin_by_module() {
       if (module_invoke($module, 'help', "admin/help#$module", $help_arg)) {
         $admin_tasks[100] = l(t('Get help'), "admin/help/$module");
       }
+      
+      // Check for README file.
+      if ($readme = system_get_readme($file)) {
+        $admin_tasks[110] = l(t('View README'), $readme);
+      }
 
       // Sort.
       ksort($admin_tasks);
@@ -200,6 +205,12 @@ function system_themes_form() {
       '#type' => 'value',
       '#value' => $theme->info,
     );
+    if ($readme = system_get_readme($theme)) {
+      $form[$theme->name]['readme'] = array(
+        '#type' => 'value',
+        '#value' => $readme,
+      );
+    }
     $options[$theme->name] = '';
     if (!empty($theme->status)) {
       $status[] = $theme->name;
@@ -601,6 +612,9 @@ function system_modules($form_state = ar
     $form['name'][$filename] = array('#value' => $file->info['name']);
     $form['version'][$filename] = array('#value' => $file->info['version']);
     $form['description'][$filename] = array('#value' => t($file->info['description']));
+    if ($readme = system_get_readme($file)) {
+      $form['readme'][$filename] = array('#value' => ' '. l(t('View README.'), $readme));
+    }
     $options[$filename] = '';
     // Ensure this module is compatible with this version of core and php.
     if (_system_is_incompatible($incompatible_core, $files, $file) || _system_is_incompatible($incompatible_php, $files, $file)) {
@@ -714,6 +728,21 @@ function system_modules($form_state = ar
 }
 
 /**
+ * Return the path to the README for a given module or theme when it supplies 
+ * a README file.
+ *
+ * @param 
+ *   A file object. In particular, the $file->filename element must be populated.
+ * 
+ * @return
+ *   A Drupal path, or NULL if no README exists
+ **/
+function system_get_readme($file) {
+  $readme = dirname($file->filename). '/README.txt';
+  return file_exists($readme) ? $readme : NULL;
+}
+
+/**
  * Form process callback function to disable check boxes.
  */
 function system_modules_disable($form, $edit) {
@@ -1916,7 +1945,7 @@ function theme_system_modules($form) {
     $rows = array();
     foreach ($modules as $key => $module) {
       $row = array();
-      $description = drupal_render($form['description'][$key]);
+      $description = drupal_render($form['description'][$key]). drupal_render($form['readme'][$key]);
       if (isset($form['status']['#incompatible_modules_core'][$key])) {
         unset($form['status'][$key]);
         $status = theme('image', 'misc/watchdog-error.png', t('incompatible'), t('Incompatible with this version of Drupal core'));
@@ -2033,8 +2062,11 @@ function theme_system_themes_form($form)
 
     // Fetch info
     $info = $form[$key]['info']['#value'];
-
     $description = $info['description'];
+    
+    if (isset($form[$key]['readme'])) {
+      $description .= ' '. l(t('View README'), $form[$key]['readme']['#value']);
+    }
     // Make sure it is compatible and render the checkbox if so.
     if (isset($form['status']['#incompatible_themes_core'][$key])) {
       unset($form['status'][$key]);
