MDL-69695 mod_folder: use forcedownload setting during inline display.
authorPaul Holden <paulh@moodle.com>
Mon, 14 Sep 2020 20:32:45 +0000 (21:32 +0100)
committerPaul Holden <paulh@moodle.com>
Mon, 14 Sep 2020 20:38:35 +0000 (21:38 +0100)
mod/folder/lib.php

index 03e2009..c450915 100644 (file)
@@ -403,7 +403,7 @@ function folder_dndupload_handle($uploadinfo) {
 function folder_get_coursemodule_info($cm) {
     global $DB;
     if (!($folder = $DB->get_record('folder', array('id' => $cm->instance),
-            'id, name, display, showexpanded, showdownloadfolder, intro, introformat'))) {
+            'id, name, display, showexpanded, showdownloadfolder, forcedownload, intro, introformat'))) {
         return NULL;
     }
     $cminfo = new cached_cm_info();
@@ -413,6 +413,7 @@ function folder_get_coursemodule_info($cm) {
         $fdata = new stdClass();
         $fdata->showexpanded = $folder->showexpanded;
         $fdata->showdownloadfolder = $folder->showdownloadfolder;
+        $fdata->forcedownload = $folder->forcedownload;
         if ($cm->showdescription && strlen(trim($folder->intro))) {
             $fdata->intro = $folder->intro;
             if ($folder->introformat != FORMAT_MOODLE) {