MDL-54113 assign: Open files in new window

Open files in a new window when viewing to ensure that the form change
checker does not warn about the page reloading.
This commit is contained in:
Andrew Nicols 2016-08-24 11:33:08 +08:00
parent 3ca3cc77a2
commit f42288ea62

View file

@ -935,7 +935,9 @@ class assign_files implements renderable {
$file->get_filename(); $file->get_filename();
$url = file_encode_url("$CFG->wwwroot/pluginfile.php", $path, true); $url = file_encode_url("$CFG->wwwroot/pluginfile.php", $path, true);
$filename = $file->get_filename(); $filename = $file->get_filename();
$file->fileurl = html_writer::link($url, $filename); $file->fileurl = html_writer::link($url, $filename, [
'target' => '_blank',
]);
} }
} }
} }