summaryrefslogtreecommitdiff
path: root/inc/media.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2009-01-16 23:06:59 +0100
committerAndreas Gohr <andi@splitbrain.org>2009-01-16 23:06:59 +0100
commit365be586ad4afda0558fdc0cdbcc8641699b855a (patch)
tree7c7de1a2c493c379b8c7a8a6d7b23c7a05e134e8 /inc/media.php
parent666cdec516655603e1a83ff884faa9c6e58b7ace (diff)
downloadrpg-365be586ad4afda0558fdc0cdbcc8641699b855a.tar.gz
rpg-365be586ad4afda0558fdc0cdbcc8641699b855a.tar.bz2
replaced str_replace with sprintf in media manager
darcs-hash:20090116220659-7ad00-176afb347702b72fdb75faa3401b5c2c4b50c6a0.gz
Diffstat (limited to 'inc/media.php')
-rw-r--r--inc/media.php73
1 files changed, 37 insertions, 36 deletions
diff --git a/inc/media.php b/inc/media.php
index 1cff2494c..5c7dd3843 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -144,19 +144,19 @@ function media_metaform($id,$auth){
* @author Michael Klier <chi@chimeric.de>
*/
function media_inuse($id) {
- global $conf;
+ global $conf;
$mediareferences = array();
if($conf['refcheck']){
require_once(DOKU_INC.'inc/fulltext.php');
$mediareferences = ft_mediause($id,$conf['refshow']);
- if(!count($mediareferences)) {
- return true;
- } else {
- return $mediareferences;
- }
+ if(!count($mediareferences)) {
+ return true;
+ } else {
+ return $mediareferences;
+ }
} else {
- return false;
- }
+ return false;
+ }
}
/**
@@ -173,34 +173,34 @@ function media_delete($id,$auth){
global $conf;
global $lang;
- $file = mediaFN($id);
-
- // trigger an event - MEDIA_DELETE_FILE
- $data['id'] = $id;
- $data['name'] = basename($file);
- $data['path'] = $file;
- $data['size'] = (@file_exists($file)) ? filesize($file) : 0;
-
- $data['unl'] = false;
- $data['del'] = false;
- $evt = new Doku_Event('MEDIA_DELETE_FILE',$data);
- if ($evt->advise_before()) {
- $data['unl'] = @unlink($file);
- if($data['unl']){
- $data['del'] = io_sweepNS($id,'mediadir');
- }
- }
- $evt->advise_after();
- unset($evt);
-
- if($data['unl'] && $data['del']){
- // current namespace was removed. redirecting to root ns passing msg along
- header('Location: '.DOKU_URL.'lib/exe/mediamanager.php?msg1='.
- rawurlencode(str_replace('%s',noNS($id),$lang['deletesucc'])));
- exit;
- }
-
- return $data['unl'];
+ $file = mediaFN($id);
+
+ // trigger an event - MEDIA_DELETE_FILE
+ $data['id'] = $id;
+ $data['name'] = basename($file);
+ $data['path'] = $file;
+ $data['size'] = (@file_exists($file)) ? filesize($file) : 0;
+
+ $data['unl'] = false;
+ $data['del'] = false;
+ $evt = new Doku_Event('MEDIA_DELETE_FILE',$data);
+ if ($evt->advise_before()) {
+ $data['unl'] = @unlink($file);
+ if($data['unl']){
+ $data['del'] = io_sweepNS($id,'mediadir');
+ }
+ }
+ $evt->advise_after();
+ unset($evt);
+
+ if($data['unl'] && $data['del']){
+ // current namespace was removed. redirecting to root ns passing msg along
+ header('Location: '.DOKU_URL.'lib/exe/mediamanager.php?msg1='.
+ rawurlencode(sprintf(noNS($id),$lang['deletesucc'])));
+ exit;
+ }
+
+ return $data['unl'];
}
/**
@@ -1020,3 +1020,4 @@ function media_resize_imageGD($ext,$from,$from_w,$from_h,$to,$to_w,$to_h,$ofs_x=
return $okay;
}
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */