* @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) {
}
session_get_instance()->write_close();
- 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 ===
$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));
}
send_file_not_found();