? .patch
? files
? mw.patch
? sites/all/themes
? themes/bluemarine/README.txt
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.11
diff -u -F^f -r1.11 system.admin.inc
--- modules/system/system.admin.inc	7 Sep 2007 12:45:28 -0000	1.11
+++ modules/system/system.admin.inc	10 Sep 2007 16:46:57 -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;
@@ -567,6 +578,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.
     if (!isset($file->info['core']) || $file->info['core'] != DRUPAL_CORE_COMPATIBILITY) {
@@ -688,6 +702,18 @@ 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) {
@@ -1883,7 +1909,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'));
@@ -2000,8 +2026,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]);
