diff options
author | Andreas Gohr <andi@splitbrain.org> | 2009-09-20 19:36:37 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2009-09-20 19:36:37 +0200 |
commit | 190c56e8489990bddc9a3ab5afa21896b9bd17dc (patch) | |
tree | 35475b3a65ce1c3408711368a8e099701cda9776 /inc/parser | |
parent | 50ecd461370efde2b5610819c593112c0a158438 (diff) | |
download | rpg-190c56e8489990bddc9a3ab5afa21896b9bd17dc.tar.gz rpg-190c56e8489990bddc9a3ab5afa21896b9bd17dc.tar.bz2 |
add icons to code block downloads
Ignore-this: a9302ef2d646771934b76f7201b6fc9e
darcs-hash:20090920173637-7ad00-012f1f953b1d173fb9f557daaf4f7c1fd90e4d07.gz
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/xhtml.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index e75fcb4c7..665307d45 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -389,8 +389,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer { global $lang; if($filename){ + // add icon + list($ext) = mimetype($filename); + $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext); + $class = 'mediafile mf_'.$class; + $this->doc .= '<dl class="'.$type.'">'.DOKU_LF; - $this->doc .= '<dt><a href="'.exportlink($ID,'code',array('codeblock'=>$this->_codeblock)).'" title="'.$lang['download'].'">'; + $this->doc .= '<dt><a href="'.exportlink($ID,'code',array('codeblock'=>$this->_codeblock)).'" title="'.$lang['download'].'" class="'.$class.'">'; $this->doc .= hsc($filename); $this->doc .= '</a></dt>'.DOKU_LF.'<dd>'; } |