Add mime picto
@ -1186,6 +1186,31 @@ function img_allow($allow)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Show mime picto
|
||||
* \param file Filename
|
||||
* \return string Return img tag
|
||||
*/
|
||||
function img_mime($file)
|
||||
{
|
||||
$mime='other';
|
||||
if (eregi('\.pdf',$file)) { $mime='pdf'; }
|
||||
if (eregi('\.(html|htm)',$file)) { $mime='html'; }
|
||||
if (eregi('\.txt',$file)) { $mime='other'; }
|
||||
if (eregi('\.php',$file)) { $mime='php'; }
|
||||
if (eregi('\.pl',$file)) { $mime='pl'; }
|
||||
if (eregi('\.js',$file)) { $mime='jscript'; }
|
||||
if (eregi('\.(png|bmp|jpg|jpeg|gif)',$file)) $mime='image';
|
||||
if (eregi('\.(mp3|ogg|au)',$file)) $mime='audio';
|
||||
if (eregi('\.(avi|mvw|divx|xvid)',$file)) $mime='video';
|
||||
if (eregi('\.(zip|rar|divx|xvid)',$file)) $mime='archive';
|
||||
$alt='Mime type: '.$mime;
|
||||
|
||||
$mime.='.png';
|
||||
return '<img src="'.DOL_URL_ROOT.'/theme/common/mime/'.$mime.'" border="0" alt="'.$alt.'" title="'.$alt.'">';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Return if a filename is file name of a supported image format
|
||||
\param file Filename
|
||||
|
||||
BIN
htdocs/theme/common/mime/archive.png
Normal file
|
After Width: | Height: | Size: 396 B |
BIN
htdocs/theme/common/mime/audio.png
Normal file
|
After Width: | Height: | Size: 336 B |
BIN
htdocs/theme/common/mime/doc.png
Normal file
|
After Width: | Height: | Size: 363 B |
BIN
htdocs/theme/common/mime/flash.png
Normal file
|
After Width: | Height: | Size: 676 B |
BIN
htdocs/theme/common/mime/html.png
Normal file
|
After Width: | Height: | Size: 393 B |
BIN
htdocs/theme/common/mime/image.png
Normal file
|
After Width: | Height: | Size: 370 B |
BIN
htdocs/theme/common/mime/jscript.png
Normal file
|
After Width: | Height: | Size: 668 B |
BIN
htdocs/theme/common/mime/notavailable.png
Normal file
|
After Width: | Height: | Size: 241 B |
BIN
htdocs/theme/common/mime/other.png
Normal file
|
After Width: | Height: | Size: 311 B |
BIN
htdocs/theme/common/mime/php.png
Normal file
|
After Width: | Height: | Size: 234 B |
BIN
htdocs/theme/common/mime/pl.png
Normal file
|
After Width: | Height: | Size: 831 B |
BIN
htdocs/theme/common/mime/ppt.png
Normal file
|
After Width: | Height: | Size: 599 B |
BIN
htdocs/theme/common/mime/quicktime.png
Normal file
|
After Width: | Height: | Size: 612 B |
BIN
htdocs/theme/common/mime/real.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
htdocs/theme/common/mime/script.png
Normal file
|
After Width: | Height: | Size: 343 B |
BIN
htdocs/theme/common/mime/svg.png
Normal file
|
After Width: | Height: | Size: 583 B |
BIN
htdocs/theme/common/mime/text.png
Normal file
|
After Width: | Height: | Size: 395 B |
BIN
htdocs/theme/common/mime/ttf.png
Normal file
|
After Width: | Height: | Size: 605 B |
BIN
htdocs/theme/common/mime/video.png
Normal file
|
After Width: | Height: | Size: 370 B |
BIN
htdocs/theme/common/mime/xls.png
Normal file
|
After Width: | Height: | Size: 688 B |