Index: theme/standard/styles_fonts.css
===================================================================
RCS file: /cvsroot/moodle/moodle/theme/standard/styles_fonts.css,v
retrieving revision 1.137
diff -u -r1.137 styles_fonts.css
--- theme/standard/styles_fonts.css	24 Sep 2007 21:55:16 -0000	1.137
+++ theme/standard/styles_fonts.css	25 Sep 2007 14:51:13 -0000
@@ -49,11 +49,17 @@
 a:visited {
   text-decoration:none;
 }
-
 a:hover {
   text-decoration: underline;
 }
 
+.img-text a:hover {
+  text-decoration: none;
+}
+.img-text a:hover span {
+  text-decoration: underline;
+}
+
 h1.main,
 h2.main,
 h3.main,
Index: lib/filelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/filelib.php,v
retrieving revision 1.49
diff -u -r1.49 filelib.php
--- lib/filelib.php	31 Aug 2007 13:54:13 -0000	1.49
+++ lib/filelib.php	25 Sep 2007 14:51:13 -0000
@@ -239,6 +239,31 @@
 }
 
 /**
+ * Get information about a filetype based on the icon file.
+ * @param string $element Desired information (usually 'icon')
+ * @param string $icon Icon file path.
+ * @return string Requested piece of information from array
+ */
+function mimeinfo_from_icon($element, $icon) {
+    static $mimeinfo;
+    $mimeinfo=get_mimetypes_array();
+
+    if (preg_match("/\/(.*)/", $icon, $matches)) {
+        $icon = $matches[1];
+    }
+    $info = $mimeinfo['xxx'][$element]; // Default
+    foreach($mimeinfo as $values) {
+        if($values['icon']==$icon) {
+            if(isset($values[$element])) {
+                $info = $values[$element];
+            }
+            //No break, for example for 'excel.gif' we don't want 'csv'!
+        }
+    }
+    return $info;
+}
+
+/**
  * Obtains descriptions for file types (e.g. 'Microsoft Word document') from the
  * mimetypes.php language file.
  * @param string $mimetype MIME type (can be obtained using the mimeinfo function)
Index: course/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/lib.php,v
retrieving revision 1.531
diff -u -r1.531 lib.php
--- course/lib.php	23 Sep 2007 13:13:13 -0000	1.531
+++ course/lib.php	25 Sep 2007 14:51:13 -0000
@@ -1348,7 +1348,7 @@
     if (!empty($section->sequence)) {
 
         // Fix bug #5027, don't want style=\"width:$width\".
-        echo "<ul class=\"section\">\n";
+        echo "<ul class=\"section img-text\">\n";
         $sectionmods = explode(",", $section->sequence);
 
         foreach ($sectionmods as $modnumber) {
@@ -1397,19 +1397,33 @@
                     }
 
                 } else { // Normal activity
-                
-                    if (!empty($USER->screenreader)) {
-                        $typestring = '('.get_string('modulename',$mod->modname).') ';
+
+                    $altname = '';
+                    //Accessibility: for files get description via icon.
+                    if ('resource'==$mod->modname) {
+                        if (!empty($modinfo[$modnumber]->icon)) {
+                            $possaltname = $modinfo[$modnumber]->icon;
+
+                            $mimetype = mimeinfo_from_icon('type', $possaltname);
+                            $altname = get_mimetype_description($mimetype); //get_string($mimetype, 'mimetypes');
+                        } else {
+                            $altname = $mod->modfullname;
+                        }
                     } else {
-                        $typestring = '';
+                        $altname = $mod->modfullname;
                     }
-                
+
+                    // Avoid unnecessary duplication.
+                    if (false!==stripos($instancename, $altname)) {
+                        $altname = '';
+                    }
+
                     $linkcss = $mod->visible ? "" : " class=\"dimmed\" ";
-                    echo '<img src="'.$icon.'"'.
-                         ' class="activityicon" alt="'.$mod->modfullname.'" />'.
-                         ' <a title="'.$mod->modfullname.'" '.$linkcss.' '.$extra.
+                    echo '<a '.$linkcss.' '.$extra.        // Title unnecessary!
                          ' href="'.$CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$mod->id.'">'.
-                         $typestring.$instancename.'</a>';
+                         '<img src="'.$icon.'" title=""'.  // Suppress IE tooltip.
+                         ' class="activityicon" alt="'.$altname.'" /> <span>'.
+                         $instancename.'</span></a>';
                 }
                 if ($usetracking && $mod->modname == 'forum') {
                     $groupmode = groups_get_course_groupmode($course, $mod);
