summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
authormatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-06-16 18:34:25 +0200
committermatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-06-16 18:34:25 +0200
commitd67ca2c0f7f6b75608386c226d33afdda872757c (patch)
tree6865ecca6d30cf4ae70a68ca85f8f22161176f33 /lib/exe
parentb59a406b93334a3a9ba2c1f2529a3bc7123361f4 (diff)
downloadrpg-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/exe')
-rw-r--r--lib/exe/media.php16
1 files changed, 9 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;
}