diff options
author | Tom N Harris <tnharris@whoopdedo.org> | 2009-09-26 01:17:46 +0200 |
---|---|---|
committer | Tom N Harris <tnharris@whoopdedo.org> | 2009-09-26 01:17:46 +0200 |
commit | 27bf79241161079d1d15f8fe1927682ec562835f (patch) | |
tree | a3bd8fee282dd481a4e4dd78aa445369b602b9d2 /inc/parser | |
parent | 66b23ce9f134c838f393fa452c450f8b6fc147c3 (diff) | |
download | rpg-27bf79241161079d1d15f8fe1927682ec562835f.tar.gz rpg-27bf79241161079d1d15f8fe1927682ec562835f.tar.bz2 |
Use all available icons for file links (FS#1759)
All PNG and GIF images in the lib/images/fileicons directory will be used
for media file links. The conf/mime.conf file continues to restrict
which file types may be uploaded. File types not in the configuration
list are download-only.
darcs-hash:20090925231746-6942e-299a52772f67e265a8702bda3686f495e4337a8f.gz
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/xhtml.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 665307d45..e67deacd6 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -390,7 +390,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { if($filename){ // add icon - list($ext) = mimetype($filename); + list($ext) = mimetype($filename,false); $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext); $class = 'mediafile mf_'.$class; @@ -710,7 +710,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $render = ($linking == 'linkonly') ? false : true; $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render); - list($ext,$mime,$dl) = mimetype($src); + list($ext,$mime,$dl) = mimetype($src,false); if(substr($mime,0,5) == 'image' && $render){ $link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache),($linking=='direct')); }elseif($mime == 'application/x-shockwave-flash' && $render){ @@ -743,16 +743,17 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $link['url'] = ml($src,array('cache'=>$cache)); - list($ext,$mime,$dl) = mimetype($src); + list($ext,$mime,$dl) = mimetype($src,false); if(substr($mime,0,5) == 'image' && $render){ - // link only jpeg images - // if ($ext != 'jpg' && $ext != 'jpeg') $noLink = true; + // link only jpeg images + // if ($ext != 'jpg' && $ext != 'jpeg') $noLink = true; }elseif($mime == 'application/x-shockwave-flash' && $render){ - // don't link flash movies - $noLink = true; + // don't link flash movies + $noLink = true; }else{ - // add file icons - $link['class'] .= ' mediafile mf_'.$ext; + // add file icons + $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext); + $link['class'] .= ' mediafile mf_'.$class; } if($hash) $link['url'] .= '#'.$hash; |