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

MDL-32471 preview thumbnails support for blocks

block_xxx_pluginfile() now accepts the $options parameter that is to be passed
to the send_stored_file() function.
parent 261cbbac
......@@ -28,9 +28,10 @@
* @param string $filearea file area
* @param array $args extra arguments
* @param bool $forcedownload whether or not force download
* @param array $options additional options affecting the file serving
* @return bool
function block_html_pluginfile($course, $birecord_or_cm, $context, $filearea, $args, $forcedownload) {
function block_html_pluginfile($course, $birecord_or_cm, $context, $filearea, $args, $forcedownload, array $options=array()) {
global $SCRIPT;
if ($context->contextlevel != CONTEXT_BLOCK) {
......@@ -64,7 +65,7 @@ function block_html_pluginfile($course, $birecord_or_cm, $context, $filearea, $a
send_stored_file($file, 60*60, 0, $forcedownload);
send_stored_file($file, 60*60, 0, $forcedownload, $options);
This files describes API changes in /blocks/* - activity modules,
information provided here is intended especially for developers.
=== 2.3 ===
required changes in code:
* block_xxx_pluginfile() is now given the 7th parameter (hopefully the last one) that
contains additional options for the file serving. The array should be re-passed
to send_stored_file().
=== 2.0 ===
......@@ -3976,7 +3976,7 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) {
$filefunction = $component.'_pluginfile';
if (function_exists($filefunction)) {
// if the function exists, it must send the file and terminate. Whatever it returns leads to "not found"
$filefunction($course, $birecord, $context, $filearea, $args, $forcedownload);
$filefunction($course, $birecord, $context, $filearea, $args, $forcedownload, array('preview' => $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