[SPIP] v3.2.1-->v3.2.3
[lhc/web/www.git] / www / plugins-dist / medias / base / typedoc.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2019 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 if (!defined('_ECRIRE_INC_VERSION')) {
14 return;
15 }
16
17 global $tables_images, $tables_sequences, $tables_documents, $tables_mime, $mime_alias;
18
19 $tables_images = array(
20 // Images reconnues par PHP
21 'jpg' => 'JPEG',
22 'png' => 'PNG',
23 'gif' => 'GIF',
24
25 // Autres images (peuvent utiliser le tag <img>)
26 'bmp' => 'BMP',
27 );
28
29 // Multimedia (peuvent utiliser le tag <embed>)
30
31 $tables_sequences = array(
32 'aac' => 'Advanced Audio Coding',
33 'ac3' => 'AC-3 Compressed Audio',
34 'aifc' => 'Compressed AIFF Audio',
35 'aiff' => 'AIFF',
36 'amr' => 'Adaptive Multi-Rate Audio',
37 'anx' => 'Annodex',
38 'ape' => 'Monkey\'s Audio File',
39 'axa' => 'Annodex Audio',
40 'axv' => 'Annodex Video',
41 'asf' => 'Windows Media',
42 'avi' => 'AVI',
43 'dv' => 'Digital Video',
44 'f4a' => 'Audio for Adobe Flash Player',
45 'f4b' => 'Audio Book for Adobe Flash Player',
46 'f4p' => 'Protected Video for Adobe Flash Player',
47 'f4v' => 'Video for Adobe Flash Player',
48 'flac' => 'Free Lossless Audio Codec',
49 'flv' => 'Flash Video',
50 'm2p' => 'MPEG-PS',
51 'm2ts' => 'BDAV MPEG-2 Transport Stream',
52 'm4a' => 'MPEG4 Audio',
53 'm4b' => 'MPEG4 Audio',
54 'm4p' => 'MPEG4 Audio',
55 'm4r' => 'iPhone Ringtone',
56 'm4v' => 'MPEG4 Video',
57 'mid' => 'Midi',
58 'mng' => 'MNG',
59 'mka' => 'Matroska Audio',
60 'mkv' => 'Matroska Video',
61 'mov' => 'QuickTime',
62 'mp3' => 'MP3',
63 'mp4' => 'MPEG4',
64 'mpc' => 'Musepack',
65 'mpg' => 'MPEG',
66 'mts' => 'AVCHD MPEG-2 transport stream',
67 'oga' => 'Ogg Audio',
68 'ogg' => 'Ogg Vorbis',
69 'ogv' => 'Ogg Video',
70 'ogx' => 'Ogg Multiplex',
71 'qt' => 'QuickTime',
72 'ra' => 'RealAudio',
73 'ram' => 'RealAudio',
74 'rm' => 'RealAudio',
75 'spx' => 'Ogg Speex',
76 'svg' => 'Scalable Vector Graphics',
77 'svgz' => 'Compressed Scalable Vector Graphic',
78 'swf' => 'Flash',
79 'tif' => 'TIFF',
80 'ts' => 'MPEG transport stream',
81 'wav' => 'WAV',
82 'webm' => 'WebM',
83 'wma' => 'Windows Media Audio',
84 'wmv' => 'Windows Media Video',
85 'y4m' => 'YUV4MPEG2',
86 '3ga' => '3GP Audio File',
87 '3gp' => '3rd Generation Partnership Project'
88 );
89
90 // Documents varies
91 $tables_documents = array(
92 '7z' => '7 Zip',
93 'abw' => 'Abiword',
94 'ai' => 'Adobe Illustrator',
95 'asx' => 'Advanced Stream Redirector',
96 'bib' => 'BibTeX',
97 'bz2' => 'BZip',
98 'bin' => 'Binary Data',
99 'blend' => 'Blender',
100 'c' => 'C source',
101 'cls' => 'LaTeX Class',
102 'csl' => 'Citation Style Language',
103 'css' => 'Cascading Style Sheet',
104 'csv' => 'Comma Separated Values',
105 'deb' => 'Debian',
106 'doc' => 'Word',
107 'dot' => 'Word Template',
108 'djvu' => 'DjVu',
109 'dvi' => 'LaTeX DVI',
110 'emf' => 'Enhanced Metafile',
111 'enl' => 'EndNote Library',
112 'ens' => 'EndNote Style',
113 'epub' => 'EPUB',
114 'eps' => 'PostScript',
115 'gpx' => 'GPS eXchange Format',
116 'gz' => 'GZ',
117 'h' => 'C header',
118 'html' => 'HTML',
119 'ics' => 'iCalendar',
120 'jar' => 'Java Archive',
121 'json' => 'JSON',
122 'kml' => 'Keyhole Markup Language',
123 'kmz' => 'Google Earth Placemark File',
124 'lyx' => 'Lyx file',
125 'mathml' => 'MathML',
126 'mbtiles' => 'MBTiles',
127 'm3u' => 'M3U Playlist',
128 'm3u8' => 'M3U8 Playlist',
129 'm4u' => 'MPEG4 Playlist',
130 'md' => 'Markdown Document',
131 'pas' => 'Pascal',
132 'pdf' => 'PDF',
133 'pgn' => 'Portable Game Notation',
134 'pls' => 'Playlist',
135 'pot' => 'PowerPoint Template',
136 'ppt' => 'PowerPoint',
137 'ps' => 'PostScript',
138 'psd' => 'Photoshop',
139 'rar' => 'WinRAR',
140 'rdf' => 'Resource Description Framework',
141 'ris' => 'RIS',
142 'rpm' => 'RedHat/Mandrake/SuSE',
143 'rtf' => 'RTF',
144 'sdc' => 'StarOffice Spreadsheet',
145 'sdd' => 'StarOffice Presentation',
146 'sdw' => 'StarOffice Writer document',
147 'sit' => 'Stuffit',
148 'sla' => 'Scribus',
149 'srt' => 'SubRip Subtitle',
150 'ssa' => 'SubStation Alpha Subtitle',
151 'sty' => 'LaTeX Style Sheet',
152 'sxc' => 'OpenOffice.org Calc',
153 'sxi' => 'OpenOffice.org Impress',
154 'sxw' => 'OpenOffice.org',
155 'tar' => 'Tar',
156 'tex' => 'LaTeX',
157 'tgz' => 'TGZ',
158 'torrent' => 'BitTorrent',
159 'ttf' => 'TTF Font',
160 'txt' => 'Texte',
161 'usf' => 'Universal Subtitle Format',
162 'vcf' => 'vCard',
163 'wmf' => 'Windows Metafile',
164 'wpl' => 'Windows Media Player Playlist',
165 'xcf' => 'GIMP multi-layer',
166 'xspf' => 'XSPF',
167 'xls' => 'Excel',
168 'xlt' => 'Excel Template',
169 'xml' => 'XML',
170 'y4m' => 'YUV4MPEG2',
171 'yaml' => 'YAML',
172 'zip' => 'Zip',
173
174 // open document format
175
176 'odb' => 'OpenDocument Database',
177 'odc' => 'OpenDocument Chart',
178 'odf' => 'OpenDocument Formula',
179 'odg' => 'OpenDocument Graphics',
180 'odi' => 'OpenDocument Image',
181 'odm' => 'OpenDocument Text-master',
182 'odp' => 'OpenDocument Presentation',
183 'ods' => 'OpenDocument Spreadsheet',
184 'odt' => 'OpenDocument Text',
185 'otg' => 'OpenDocument Graphics-template',
186 'otp' => 'OpenDocument Presentation-template',
187 'ots' => 'OpenDocument Spreadsheet-template',
188 'ott' => 'OpenDocument Text-template',
189
190
191 // Open XML File Formats
192 'docm' => 'Word',
193 'docx' => 'Word',
194 'dotm' => 'Word template',
195 'dotx' => 'Word template',
196
197 'potm' => 'Powerpoint template',
198 'potx' => 'Powerpoint template',
199 'ppam' => 'Powerpoint addin',
200 'ppsm' => 'Powerpoint slideshow',
201 'ppsx' => 'Powerpoint slideshow',
202 'pptm' => 'Powerpoint',
203 'pptx' => 'Powerpoint',
204
205 'xlam' => 'Excel',
206 'xlsb' => 'Excel binary',
207 'xlsm' => 'Excel',
208 'xlsx' => 'Excel',
209 'xltm' => 'Excel template',
210 'xltx' => 'Excel template'
211 );
212
213 $tables_mime = array(
214 // Images reconnues par PHP
215 'jpg' => 'image/jpeg',
216 'png' => 'image/png',
217 'gif' => 'image/gif',
218
219 // Autres images (peuvent utiliser le tag <img>)
220 'bmp' => 'image/x-ms-bmp', // pas enregistre par IANA, variante: image/bmp
221 'tif' => 'image/tiff',
222
223 // Multimedia (peuvent utiliser le tag <embed>)
224 'aac' => 'audio/mp4a-latm',
225 'ac3' => 'audio/x-aac',
226 'aifc' => 'audio/x-aifc',
227 'aiff' => 'audio/x-aiff',
228 'amr' => 'audio/amr',
229 'ape' => 'audio/x-monkeys-audio',
230 'asf' => 'video/x-ms-asf',
231 'avi' => 'video/x-msvideo',
232 'anx' => 'application/annodex',
233 'axa' => 'audio/annodex',
234 'axv' => 'video/annodex',
235 'dv' => 'video/x-dv',
236 'f4a' => 'audio/mp4',
237 'f4b' => 'audio/mp4',
238 'f4p' => 'video/mp4',
239 'f4v' => 'video/mp4',
240 'flac' => 'audio/x-flac',
241 'flv' => 'video/x-flv',
242 'm2p' => 'video/MP2P',
243 'm2ts' => 'video/MP2T',
244 'm4a' => 'audio/mp4a-latm',
245 'm4b' => 'audio/mp4a-latm',
246 'm4p' => 'audio/mp4a-latm',
247 'm4r' => 'audio/aac',
248 'm4u' => 'video/vnd.mpegurl',
249 'm4v' => 'video/x-m4v',
250 'mid' => 'audio/midi',
251 'mka' => 'audio/mka',
252 'mkv' => 'video/mkv',
253 'mng' => 'video/x-mng',
254 'mov' => 'video/quicktime',
255 'mp3' => 'audio/mpeg',
256 'mp4' => 'application/mp4',
257 'mpc' => 'audio/x-musepack',
258 'mpg' => 'video/mpeg',
259 'mts' => 'video/MP2T',
260 'oga' => 'audio/ogg',
261 'ogg' => 'audio/ogg',
262 'ogv' => 'video/ogg',
263 'ogx' => 'application/ogg',
264 'qt' => 'video/quicktime',
265 'ra' => 'audio/x-pn-realaudio',
266 'ram' => 'audio/x-pn-realaudio',
267 'rm' => 'audio/x-pn-realaudio',
268 'spx' => 'audio/ogg',
269 'svg' => 'image/svg+xml',
270 'svgz' => 'image/svg+xml',
271 'swf' => 'application/x-shockwave-flash',
272 'ts' => 'video/MP2T',
273 'wav' => 'audio/x-wav',
274 'webm' => 'video/webm',
275 'wma' => 'audio/x-ms-wma',
276 'wmv' => 'video/x-ms-wmv',
277 'y4m' => 'video/x-raw-yuv',
278 '3gp' => 'video/3gpp',
279 '3ga' => 'audio/3ga',
280
281 // Documents varies
282 '7z' => 'application/x-7z-compressed',
283 'ai' => 'application/illustrator',
284 'abw' => 'application/abiword',
285 'asx' => 'video/x-ms-asf',
286 'bib' => 'application/x-bibtex',
287 'bin' => 'application/octet-stream', # le tout-venant
288 'blend' => 'application/x-blender',
289 'bz2' => 'application/x-bzip2',
290 'c' => 'text/x-csrc',
291 'csl' => 'application/xml',
292 'css' => 'text/css',
293 'csv' => 'text/csv',
294 'deb' => 'application/x-debian-package',
295 'doc' => 'application/msword',
296 'dot' => 'application/msword',
297 'djvu' => 'image/vnd.djvu',
298 'dvi' => 'application/x-dvi',
299 'emf' => 'image/x-emf',
300 'enl' => 'application/octet-stream',
301 'ens' => 'application/octet-stream',
302 'eps' => 'application/postscript',
303 'epub' => 'application/epub+zip', // pas enregistre par IANA
304 'gpx' => 'application/gpx+xml', // pas enregistre par IANA
305 'gz' => 'application/x-gzip',
306 'h' => 'text/x-chdr',
307 'html' => 'text/html',
308 'ics' => 'text/calendar',
309 'jar' => 'application/java-archive',
310 'json' => 'application/json',
311 'kml' => 'application/vnd.google-earth.kml+xml',
312 'kmz' => 'application/vnd.google-earth.kmz',
313 'lyx' => 'application/x-lyx',
314 'm3u' => 'text/plain',
315 'm3u8' => 'text/plain',
316 'mathml' => 'application/mathml+xml',
317 'mbtiles' => 'application/x-sqlite3',
318 'md' => 'text/x-markdown',
319 'pas' => 'text/x-pascal',
320 'pdf' => 'application/pdf',
321 'pgn' => 'application/x-chess-pgn',
322 'pls' => 'text/plain',
323 'ppt' => 'application/vnd.ms-powerpoint',
324 'pot' => 'application/vnd.ms-powerpoint',
325 'ps' => 'application/postscript',
326 'psd' => 'image/x-photoshop', // pas enregistre par IANA
327 'rar' => 'application/x-rar-compressed',
328 'rdf' => 'application/rdf+xml',
329 'ris' => 'application/x-research-info-systems',
330 'rpm' => 'application/x-redhat-package-manager',
331 'rtf' => 'application/rtf',
332 'sdc' => 'application/vnd.stardivision.calc',
333 'sdd' => 'application/vnd.stardivision.impress',
334 'sdw' => 'application/vnd.stardivision.writer',
335 'sit' => 'application/x-stuffit',
336 'sla' => 'application/x-scribus',
337 'srt' => 'text/plain',
338 'ssa' => 'text/plain',
339 'sxc' => 'application/vnd.sun.xml.calc',
340 'sxi' => 'application/vnd.sun.xml.impress',
341 'sxw' => 'application/vnd.sun.xml.writer',
342 'tar' => 'application/x-tar',
343 'tex' => 'text/x-tex',
344 'tgz' => 'application/x-gtar',
345 'torrent' => 'application/x-bittorrent',
346 'ttf' => 'application/x-font-ttf',
347 'txt' => 'text/plain',
348 'usf' => 'application/xml',
349 'vcf' => 'text/vcard',
350 'xcf' => 'application/x-xcf',
351 'xls' => 'application/vnd.ms-excel',
352 'xlt' => 'application/vnd.ms-excel',
353 'wmf' => 'image/x-emf',
354 'wpl' => 'application/vnd.ms-wpl',
355 'xspf' => 'application/xspf+xml',
356 'xml' => 'application/xml',
357 'yaml' => 'text/yaml',
358 'zip' => 'application/zip',
359
360 // Open Document format
361 'odt' => 'application/vnd.oasis.opendocument.text',
362 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
363 'odp' => 'application/vnd.oasis.opendocument.presentation',
364 'odg' => 'application/vnd.oasis.opendocument.graphics',
365 'odc' => 'application/vnd.oasis.opendocument.chart',
366 'odf' => 'application/vnd.oasis.opendocument.formula',
367 'odb' => 'application/vnd.oasis.opendocument.database',
368 'odi' => 'application/vnd.oasis.opendocument.image',
369 'odm' => 'application/vnd.oasis.opendocument.text-master',
370 'ott' => 'application/vnd.oasis.opendocument.text-template',
371 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
372 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
373 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
374
375 'cls' => 'text/x-tex',
376 'sty' => 'text/x-tex',
377
378 // Open XML File Formats
379 'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
380 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
381 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
382 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
383
384 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
385 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
386 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
387 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
388 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
389 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
390 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
391
392 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
393 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
394 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
395 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
396 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
397 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'
398 );
399
400
401 $mime_alias = array(
402 'application/x-ogg' => 'application/ogg',
403 'audio/3gpp' => 'video/3gpp',
404 'audio/x-mpeg' => 'audio/mpeg',
405 'audio/x-musepack' => 'audio/musepack',
406 'audio/webm' => 'video/webm',
407 'video/flv' => 'video/x-flv',
408 'video/mp4' => 'application/mp4',
409 'image/jpg' => 'image/jpeg'
410 );