diff options
author | Michael Hamann <michael@content-space.de> | 2011-09-08 11:27:42 +0200 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2011-09-08 11:39:00 +0200 |
commit | fb46ebd87eb43d5cd9f67f353f6656d0e3a0b196 (patch) | |
tree | b89b580659168d8550dcca66fb0c303389b77aaf /inc/pageutils.php | |
parent | aea34b5fe445064477d8ad0c98926db33a0d0851 (diff) | |
parent | cc2c0b9d6af82732ed79eeb85c22b7c3192a4e55 (diff) | |
download | rpg-fb46ebd87eb43d5cd9f67f353f6656d0e3a0b196.tar.gz rpg-fb46ebd87eb43d5cd9f67f353f6656d0e3a0b196.tar.bz2 |
Merge branch 'media-revisions'
This introduces a new media manager and media revisions to DokuWiki. The
changes have been implemented by Kate Arzamastseva and are the
result of a Google Summer of Code project, the official project page can
be found at
http://www.google-melange.com/gsoc/project/google/gsoc2011/kate/18001
Thanks to Kate for the work and Google for sponsoring it!
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r-- | inc/pageutils.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php index c9bf60135..81dcb66e7 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -295,8 +295,6 @@ function wikiLockFN($id) { /** * returns the full path to the meta file specified by ID and extension * - * The filename is URL encoded to protect Unicode chars - * * @author Steven Danz <steven-danz@kc.rr.com> */ function metaFN($id,$ext){ @@ -308,6 +306,19 @@ function metaFN($id,$ext){ } /** + * returns the full path to the media's meta file specified by ID and extension + * + * @author Kate Arzamastseva <pshns@ukr.net> + */ +function mediaMetaFN($id,$ext){ + global $conf; + $id = cleanID($id); + $id = str_replace(':','/',$id); + $fn = $conf['mediametadir'].'/'.utf8_encodeFN($id).$ext; + return $fn; +} + +/** * returns an array of full paths to all metafiles of a given ID * * @author Esther Brunner <esther@kaffeehaus.ch> @@ -326,12 +337,19 @@ function metaFiles($id){ * The filename is URL encoded to protect Unicode chars * * @author Andreas Gohr <andi@splitbrain.org> + * @author Kate Arzamastseva <pshns@ukr.net> */ -function mediaFN($id){ +function mediaFN($id, $rev=''){ global $conf; $id = cleanID($id); $id = str_replace(':','/',$id); - $fn = $conf['mediadir'].'/'.utf8_encodeFN($id); + if(empty($rev)){ + $fn = $conf['mediadir'].'/'.utf8_encodeFN($id); + }else{ + $ext = mimetype($id); + $name = substr($id,0, -1*strlen($ext[0])-1); + $fn = $conf['mediaolddir'].'/'.utf8_encodeFN($name .'.'.( (int) $rev ).'.'.$ext[0]); + } return $fn; } |