Skip to content

Commit

Permalink
MDL-32471 pluginfile.php accepts optional parameter 'preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Apr 24, 2012
1 parent ead4f18 commit b071498
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/filelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion pluginfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.