Permalink
Browse files

MDL-32471 pluginfile.php accepts optional parameter 'preview'

  • Loading branch information...
1 parent ead4f18 commit b071498f1bc45b6d7f3afe887a67b1100d3efc2e @mudrd8mz mudrd8mz committed Apr 17, 2012
Showing with 4 additions and 2 deletions.
  1. +2 −1 lib/filelib.php
  2. +2 −1 pluginfile.php
View
@@ -3211,9 +3211,10 @@ public function get_extensions($types) {
*
* @param string $relativepath
* @param bool $forcedownload
+ * @param null|string $preview the preview mode, defaults to serving the original file
* @todo MDL-31088 file serving improments
*/
-function file_pluginfile($relativepath, $forcedownload) {
+function file_pluginfile($relativepath, $forcedownload, $preview = null) {
global $DB, $CFG, $USER;
// relative path must start with '/'
if (!$relativepath) {
View
@@ -33,5 +33,6 @@
$relativepath = get_file_argument();
$forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
+$preview = optional_param('preview', null, PARAM_ALPHANUM);
-file_pluginfile($relativepath, $forcedownload);
+file_pluginfile($relativepath, $forcedownload, $preview);

0 comments on commit b071498

Please sign in to comment.