mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-38261-workshop-attachments-size' of git://github.com/mudrd8mz/moodle
This commit is contained in:
commit
cdbbd48a66
@ -334,6 +334,9 @@ class file_storage {
|
||||
} else if ($mode === 'thumb') {
|
||||
$data = generate_image_thumbnail($tmpfilepath, 90, 90);
|
||||
|
||||
} else if ($mode === 'bigthumb') {
|
||||
$data = generate_image_thumbnail($tmpfilepath, 250, 250);
|
||||
|
||||
} else {
|
||||
throw new file_exception('storedfileproblem', 'Invalid preview mode requested');
|
||||
}
|
||||
|
@ -797,8 +797,11 @@ class mod_workshop_renderer extends plugin_renderer_base {
|
||||
|
||||
$filepath = $file->get_filepath();
|
||||
$filename = $file->get_filename();
|
||||
$fileurl = file_encode_url($CFG->wwwroot . '/pluginfile.php',
|
||||
'/' . $ctx->id . '/mod_workshop/submission_attachment/' . $submissionid . $filepath . $filename, true);
|
||||
$fileurl = moodle_url::make_pluginfile_url($ctx->id, 'mod_workshop', 'submission_attachment',
|
||||
$submissionid, $filepath, $filename, true);
|
||||
$embedurl = moodle_url::make_pluginfile_url($ctx->id, 'mod_workshop', 'submission_attachment',
|
||||
$submissionid, $filepath, $filename, false);
|
||||
$embedurl = new moodle_url($embedurl, array('preview' => 'bigthumb'));
|
||||
$type = $file->get_mimetype();
|
||||
$image = $this->output->pix_icon(file_file_icon($file), get_mimetype_description($file), 'moodle', array('class' => 'icon'));
|
||||
|
||||
@ -807,7 +810,7 @@ class mod_workshop_renderer extends plugin_renderer_base {
|
||||
|
||||
if ($format == 'html') {
|
||||
if (file_mimetype_in_typegroup($type, 'web_image')) {
|
||||
$preview = html_writer::empty_tag('img', array('src' => $fileurl, 'alt' => '', 'class' => 'preview'));
|
||||
$preview = html_writer::empty_tag('img', array('src' => $embedurl, 'alt' => '', 'class' => 'preview'));
|
||||
$preview = html_writer::tag('a', $preview, array('href' => $fileurl));
|
||||
$outputimgs .= $this->output->container($preview);
|
||||
|
||||
|
@ -137,6 +137,13 @@
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.path-mod-workshop .submission-full .attachments .images div {
|
||||
display: inline-block;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Example submission - summary display
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user