Fixed firstname lastname to call to fullname function
[moodle.git] / files / mimetypes.php
CommitLineData
4c48acf0 1<?php // $Id$
704d5956 2
3function mimeinfo($element, $filename) {
4 $mimeinfo = array (
5 "xxx" => array ("type"=>"document/unknown", "icon"=>"unknown.gif"),
602bde06 6 "3gp" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
704d5956 7 "ai" => array ("type"=>"application/postscript", "icon"=>"image.gif"),
8 "aif" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
9 "aiff" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
10 "aifc" => array ("type"=>"audio/x-aiff", "icon"=>"audio.gif"),
11 "applescript" => array ("type"=>"text/plain", "icon"=>"text.gif"),
12 "asc" => array ("type"=>"text/plain", "icon"=>"text.gif"),
13 "au" => array ("type"=>"audio/au", "icon"=>"audio.gif"),
14 "avi" => array ("type"=>"video/x-ms-wm", "icon"=>"avi.gif"),
15 "bmp" => array ("type"=>"image/bmp", "icon"=>"image.gif"),
16 "cs" => array ("type"=>"application/x-csh", "icon"=>"text.gif"),
17 "css" => array ("type"=>"text/css", "icon"=>"text.gif"),
18 "dv" => array ("type"=>"video/x-dv", "icon"=>"video.gif"),
19 "doc" => array ("type"=>"application/msword", "icon"=>"word.gif"),
20 "dif" => array ("type"=>"video/x-dv", "icon"=>"video.gif"),
a844bc04 21 "eps" => array ("type"=>"application/postscript", "icon"=>"pdf.gif"),
704d5956 22 "gif" => array ("type"=>"image/gif", "icon"=>"image.gif"),
23 "gtar" => array ("type"=>"application/x-gtar", "icon"=>"zip.gif"),
7969713a 24 "gz" => array ("type"=>"application/g-zip", "icon"=>"zip.gif"),
704d5956 25 "gzip" => array ("type"=>"application/g-zip", "icon"=>"zip.gif"),
26 "h" => array ("type"=>"text/plain", "icon"=>"text.gif"),
27 "hqx" => array ("type"=>"application/mac-binhex40", "icon"=>"zip.gif"),
28 "html" => array ("type"=>"text/html", "icon"=>"html.gif"),
29 "htm" => array ("type"=>"text/html", "icon"=>"html.gif"),
30 "jpe" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
31 "jpeg" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
32 "jpg" => array ("type"=>"image/jpeg", "icon"=>"image.gif"),
33 "js" => array ("type"=>"application/x-javascript", "icon"=>"text.gif"),
34 "latex"=> array ("type"=>"application/x-latex", "icon"=>"text.gif"),
35 "m" => array ("type"=>"text/plain", "icon"=>"text.gif"),
36 "mov" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
37 "movie"=> array ("type"=>"video/x-sgi-movie", "icon"=>"video.gif"),
38 "m3u" => array ("type"=>"audio/x-mpegurl", "icon"=>"audio.gif"),
39 "mp3" => array ("type"=>"audio/mp3", "icon"=>"audio.gif"),
40 "mp4" => array ("type"=>"video/mp4", "icon"=>"video.gif"),
41 "mpeg" => array ("type"=>"video/mpeg", "icon"=>"video.gif"),
42 "mpe" => array ("type"=>"video/mpeg", "icon"=>"video.gif"),
43 "mpg" => array ("type"=>"video/mpeg", "icon"=>"video.gif"),
44 "pct" => array ("type"=>"image/pict", "icon"=>"image.gif"),
45 "pdf" => array ("type"=>"application/pdf", "icon"=>"pdf.gif"),
46 "php" => array ("type"=>"text/plain", "icon"=>"text.gif"),
47 "pic" => array ("type"=>"image/pict", "icon"=>"image.gif"),
48 "pict" => array ("type"=>"image/pict", "icon"=>"image.gif"),
49 "png" => array ("type"=>"image/png", "icon"=>"image.gif"),
5debc7a8 50 "pps" => array ("type"=>"application/vnd.ms-powerpoint", "icon"=>"powerpoint.gif"),
704d5956 51 "ppt" => array ("type"=>"application/vnd.ms-powerpoint", "icon"=>"powerpoint.gif"),
a844bc04 52 "ps" => array ("type"=>"application/postscript", "icon"=>"pdf.gif"),
704d5956 53 "qt" => array ("type"=>"video/quicktime", "icon"=>"video.gif"),
54 "ra" => array ("type"=>"audio/x-realaudio", "icon"=>"audio.gif"),
55 "ram" => array ("type"=>"audio/x-pn-realaudio", "icon"=>"audio.gif"),
56 "rm" => array ("type"=>"audio/x-pn-realaudio", "icon"=>"audio.gif"),
57 "rtf" => array ("type"=>"text/rtf", "icon"=>"text.gif"),
58 "rtx" => array ("type"=>"text/richtext", "icon"=>"text.gif"),
59 "sh" => array ("type"=>"application/x-sh", "icon"=>"text.gif"),
60 "sit" => array ("type"=>"application/x-stuffit", "icon"=>"zip.gif"),
61 "smi" => array ("type"=>"application/smil", "icon"=>"text.gif"),
62 "smil" => array ("type"=>"application/smil", "icon"=>"text.gif"),
63 "swf" => array ("type"=>"application/x-shockwave-flash", "icon"=>"flash.gif"),
64 "tar" => array ("type"=>"application/x-tar", "icon"=>"zip.gif"),
65 "tif" => array ("type"=>"image/tiff", "icon"=>"image.gif"),
66 "tiff" => array ("type"=>"image/tiff", "icon"=>"image.gif"),
67 "tex" => array ("type"=>"application/x-tex", "icon"=>"text.gif"),
68 "texi" => array ("type"=>"application/x-texinfo", "icon"=>"text.gif"),
69 "texinfo" => array ("type"=>"application/x-texinfo", "icon"=>"text.gif"),
70 "tsv" => array ("type"=>"text/tab-separated-values", "icon"=>"text.gif"),
71 "txt" => array ("type"=>"text/plain", "icon"=>"text.gif"),
72 "wav" => array ("type"=>"audio/wav", "icon"=>"audio.gif"),
98a45cd7 73 "wmv" => array ("type"=>"video/x-ms-wmv", "icon"=>"avi.gif"),
393137e2 74 "asf" => array ("type"=>"video/x-ms-asf", "icon"=>"avi.gif"),
704d5956 75 "xls" => array ("type"=>"application/vnd.ms-excel", "icon"=>"excel.gif"),
76 "xml" => array ("type"=>"text/xml", "icon"=>"xml.gif"),
77 "xsl" => array ("type"=>"text/xml", "icon"=>"xml.gif"),
78 "zip" => array ("type"=>"application/zip", "icon"=>"zip.gif")
79 );
80
81 if (eregi("\.([a-z0-9]+)$", $filename, $match)) {
8ccc9d06 82 if(isset($mimeinfo[strtolower($match[1])][$element])) {
83 return $mimeinfo[strtolower($match[1])][$element];
84 } else {
85 return $mimeinfo["xxx"][$element]; // By default
86 }
704d5956 87 } else {
88 return $mimeinfo["xxx"][$element]; // By default
89 }
90}
91
92?>