PDFs should be inline not attachments #153
This commit is contained in:
parent
27f5a74cb3
commit
0c89ff9547
2 changed files with 4 additions and 2 deletions
|
@ -320,7 +320,7 @@ class template {
|
||||||
return $pdf->Output('', 'S');
|
return $pdf->Output('', 'S');
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->Output($filename, 'D');
|
$pdf->Output($filename, 'I');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
view.php
4
view.php
|
@ -139,7 +139,7 @@ if (!$downloadown && !$downloadissue) {
|
||||||
if ($canreceive) {
|
if ($canreceive) {
|
||||||
$linkname = get_string('getcustomcert', 'customcert');
|
$linkname = get_string('getcustomcert', 'customcert');
|
||||||
$link = new moodle_url('/mod/customcert/view.php', array('id' => $cm->id, 'downloadown' => true));
|
$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->class .= ' m-b-1'; // Seems a bit hackish, ahem.
|
||||||
$downloadbutton = $OUTPUT->render($downloadbutton);
|
$downloadbutton = $OUTPUT->render($downloadbutton);
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,8 @@ if (!$downloadown && !$downloadissue) {
|
||||||
redirect(new moodle_url('/mod/customcert/view.php', array('id' => $cm->id)));
|
redirect(new moodle_url('/mod/customcert/view.php', array('id' => $cm->id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\core\session\manager::write_close();
|
||||||
|
|
||||||
// Now we want to generate the PDF.
|
// Now we want to generate the PDF.
|
||||||
$template = new \mod_customcert\template($template);
|
$template = new \mod_customcert\template($template);
|
||||||
$template->generate_pdf(false, $userid);
|
$template->generate_pdf(false, $userid);
|
||||||
|
|
Loading…
Reference in a new issue