MDL-38261 Display workshop submission attachments in a preview mode
This commit is contained in:
@@ -799,6 +799,7 @@ class mod_workshop_renderer extends plugin_renderer_base {
|
||||
$filename = $file->get_filename();
|
||||
$fileurl = file_encode_url($CFG->wwwroot . '/pluginfile.php',
|
||||
'/' . $ctx->id . '/mod_workshop/submission_attachment/' . $submissionid . $filepath . $filename, true);
|
||||
$embedurl = new moodle_url($fileurl, 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 +808,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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user