PDFs should be inline not attachments #153

This commit is contained in:
Brendan Heywood 2020-11-04 14:25:36 +11:00 committed by Mark Nelson
parent 27f5a74cb3
commit 0c89ff9547
2 changed files with 4 additions and 2 deletions

View file

@ -320,7 +320,7 @@ class template {
return $pdf->Output('', 'S');
}
$pdf->Output($filename, 'D');
$pdf->Output($filename, 'I');
}
}

View file

@ -139,7 +139,7 @@ if (!$downloadown && !$downloadissue) {
if ($canreceive) {
$linkname = get_string('getcustomcert', 'customcert');
$link = new moodle_url('/mod/customcert/view.php', array('id' => $cm->id, 'downloadown' => true));
$downloadbutton = new single_button($link, $linkname, 'post', true);
$downloadbutton = new single_button($link, $linkname, 'get', true);
$downloadbutton->class .= ' m-b-1'; // Seems a bit hackish, ahem.
$downloadbutton = $OUTPUT->render($downloadbutton);
}
@ -179,6 +179,8 @@ if (!$downloadown && !$downloadissue) {
redirect(new moodle_url('/mod/customcert/view.php', array('id' => $cm->id)));
}
\core\session\manager::write_close();
// Now we want to generate the PDF.
$template = new \mod_customcert\template($template);
$template->generate_pdf(false, $userid);