diff options
author | Andreas Gohr <andi@splitbrain.org> | 2005-11-05 16:59:11 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2005-11-05 16:59:11 +0100 |
commit | d15166e51c96cb4055d6786ed5c4bf1980058bae (patch) | |
tree | ff86ca1d9a3140c3613a18fa5d608a609026405d /lib | |
parent | 9ab75d9e5b40b2a68d2904f6f190a30326f0378a (diff) | |
download | rpg-d15166e51c96cb4055d6786ed5c4bf1980058bae.tar.gz rpg-d15166e51c96cb4055d6786ed5c4bf1980058bae.tar.bz2 |
use classes for file icons like in interwiki links
darcs-hash:20051105155911-7ad00-ecba6272c534f73fc1ace47152187be87ef7c6d3.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/exe/css.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php index 2fb30999a..9874299b0 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -66,8 +66,9 @@ function css_out(){ // start output buffering and build the stylesheet ob_start(); - // print the default classes for Interwikilinks + // print the default classes for interwiki links and file downloads css_interwiki(); + css_filetypes(); // load files foreach($files as $file => $location){ @@ -163,7 +164,34 @@ function css_interwiki(){ echo '}'; } } +} + +/** + * Prints classes for file download links + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function css_filetypes(){ + // default style + echo 'a.mediafile {'; + echo ' background: transparent url('.DOKU_BASE.'lib/images/fileicons/file.png) 0px 1px no-repeat;'; + echo ' padding-left: 16px;'; + echo '}'; + + // additional styles when icon available + $mimes = getMimeTypes(); + foreach(array_keys($mimes) as $mime){ + if(@file_exists(DOKU_INC.'lib/images/fileicons/'.$mime.'.png')){ + echo "a.mf_$mime {"; + echo ' background-image: url('.DOKU_BASE.'lib/images/fileicons/'.$mime.'.png)'; + echo '}'; + }elseif(@file_exists(DOKU_INC.'lib/images/fileicons/'.$mime.'.gif')){ + echo "a.mf_$mime {"; + echo ' background-image: url('.DOKU_BASE.'lib/images/fileicons/'.$mime.'.gif)'; + echo '}'; + } + } } /** |