diff options
author | matthiasgrimm <matthiasgrimm@users.sourceforge.net> | 2005-06-16 18:34:25 +0200 |
---|---|---|
committer | matthiasgrimm <matthiasgrimm@users.sourceforge.net> | 2005-06-16 18:34:25 +0200 |
commit | d67ca2c0f7f6b75608386c226d33afdda872757c (patch) | |
tree | 6865ecca6d30cf4ae70a68ca85f8f22161176f33 /lib | |
parent | b59a406b93334a3a9ba2c1f2529a3bc7123361f4 (diff) | |
download | rpg-d67ca2c0f7f6b75608386c226d33afdda872757c.tar.gz rpg-d67ca2c0f7f6b75608386c226d33afdda872757c.tar.bz2 |
media reference check part 2
Part 1 only checks for the existance of references.
Part 2 will show where this references are so that the user
could easily find them.
Both parts are configurable:
refcheck
darcs-hash:20050616163425-7ef76-a7fce6cd1ef5d2cc2e4ac3b869969a65c671770a.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/exe/media.php | 16 | ||||
-rw-r--r-- | lib/tpl/default/layout.css | 24 |
2 files changed, 33 insertions, 7 deletions
diff --git a/lib/exe/media.php b/lib/exe/media.php index f0d0795ad..27975a493 100644 --- a/lib/exe/media.php +++ b/lib/exe/media.php @@ -41,9 +41,8 @@ } if(!count($mediareferences)){ media_delete($DEL); - }else{ - $text = str_replace('%s',noNS($DEL),$lang['mediainuse']); - msg($text,0); + }elseif(!$conf['refshow']){ + msg(str_replace('%s',noNS($DEL),$lang['mediainuse']),0); } } @@ -54,8 +53,12 @@ //start output and load template header('Content-Type: text/html; charset=utf-8'); - include(DOKU_INC.'lib/tpl/'.$conf['template'].'/media.php'); - + if($conf['refshow'] && count($mediareferences)){ + include(DOKU_INC.'lib/tpl/'.$conf['template'].'/mediaref.php'); + }else{ + include(DOKU_INC.'lib/tpl/'.$conf['template'].'/media.php'); + } + //restore old umask umask($conf['oldumask']); @@ -75,8 +78,7 @@ function media_delete($delid){ return true; } //something went wrong - $text = str_replace('%s',$file,$lang['deletefail']); - msg($text,-1); + msg(str_replace('%s',$file,$lang['deletefail']),-1); return false; } diff --git a/lib/tpl/default/layout.css b/lib/tpl/default/layout.css index fea7c58ab..45fed3d49 100644 --- a/lib/tpl/default/layout.css +++ b/lib/tpl/default/layout.css @@ -107,3 +107,27 @@ div.uploadform { padding: 0.5em; width:65%; } + +div.mediaref_head { + margin-left:0.5em; +} + +div.mediaref .search_result { + padding-left:1em; +} + +.mediaref_ref { + color:#009900; +} + +div.mediaref_hidden { + margin-top:1em; + text-align:center; + font-size:1.2em; + color:#BB0000; +} + +div.mediaref_footer { + margin-top:1em; + text-align:center; +} |