MDL-77646 lib: Use iframe instead of object to display pdf.

This commit is contained in:
Derek Henderson
2025-03-11 13:52:51 +01:00
committed by Luca Bösch
parent 4df87b3130
commit 1fc38904e1
+6 -7
View File
@@ -233,13 +233,12 @@ function resourcelib_embed_pdf($fullurl, $title, $clicktoopen) {
global $CFG, $PAGE;
$code = <<<EOT
<div class="resourcecontent resourcepdf">
<object id="resourceobject" data="$fullurl" type="application/pdf" width="800" height="600">
<param name="src" value="$fullurl" />
$clicktoopen
</object>
</div>
EOT;
<div class="resourcecontent resourcepdf">
<iframe id="resourceobject" src="$fullurl" title="$title" width="800" height="600">
$clicktoopen
</iframe>
</div>
EOT;
// the size is hardcoded in the boject obove intentionally because it is adjusted by the following function on-the-fly
$PAGE->requires->js_init_call('M.util.init_maximised_embed', array('resourceobject'), true);