Commit b071498f authored by David Mudrák's avatar David Mudrák
Browse files

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

parent ead4f180
...@@ -3211,9 +3211,10 @@ class filetype_parser { ...@@ -3211,9 +3211,10 @@ class filetype_parser {
* *
* @param string $relativepath * @param string $relativepath
* @param bool $forcedownload * @param bool $forcedownload
* @param null|string $preview the preview mode, defaults to serving the original file
* @todo MDL-31088 file serving improments * @todo MDL-31088 file serving improments
*/ */
function file_pluginfile($relativepath, $forcedownload) { function file_pluginfile($relativepath, $forcedownload, $preview = null) {
global $DB, $CFG, $USER; global $DB, $CFG, $USER;
// relative path must start with '/' // relative path must start with '/'
if (!$relativepath) { if (!$relativepath) {
......
...@@ -33,5 +33,6 @@ require_once('lib/filelib.php'); ...@@ -33,5 +33,6 @@ require_once('lib/filelib.php');
$relativepath = get_file_argument(); $relativepath = get_file_argument();
$forcedownload = optional_param('forcedownload', 0, PARAM_BOOL); $forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
$preview = optional_param('preview', null, PARAM_ALPHANUM);
file_pluginfile($relativepath, $forcedownload); file_pluginfile($relativepath, $forcedownload, $preview);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment