MDL-58334 repositories: Offline downloads

Support an optional param for offline downloads for repositories supporting external links (googledrive and skydrive).

Part of MDL-58220
This commit is contained in:
Damyon Wiese
2017-04-03 13:43:25 +08:00
parent fa78244d17
commit d5bb9f1ffc
4 changed files with 57 additions and 39 deletions
+4 -1
View File
@@ -33,5 +33,8 @@ require_once('lib/filelib.php');
$relativepath = get_file_argument();
$forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
$preview = optional_param('preview', null, PARAM_ALPHANUM);
// Offline means download the file from the repository and serve it, even if it was an external link.
// The repository may have to export the file to an offline format.
$offline = optional_param('offline', 0, PARAM_BOOL);
file_pluginfile($relativepath, $forcedownload, $preview);
file_pluginfile($relativepath, $forcedownload, $preview, $offline);