]> git.mjollnir.org Git - moodle.git/commitdiff
Fix MDL-7436 Accessibility "Indicate type of resource in the name of the resource"
authornfreear <nfreear>
Tue, 25 Sep 2007 14:59:16 +0000 (14:59 +0000)
committernfreear <nfreear>
Tue, 25 Sep 2007 14:59:16 +0000 (14:59 +0000)
lib/filelib.php
theme/standard/styles_fonts.css

index 0feb39abf995ce363c3760056c40f3390207cfe1..c9a7846745f291444c89730725ffad5574c0324b 100644 (file)
@@ -238,6 +238,31 @@ function mimeinfo_from_type($element, $mimetype) {
     return $mimeinfo['xxx'][$element]; // Default
 }
 
+/**
+ * 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.
index 168566439aecaf296b1e0f3713cd761681df7b65..0739860606e37a0c768bd198c779780b4c997c51 100644 (file)
@@ -49,11 +49,17 @@ a:link,
 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,