mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-77646 lib: Use iframe instead of object to display pdf.
This commit is contained in:
parent
1e51bc0b9c
commit
392f443e5c
1 changed files with 6 additions and 7 deletions
|
@ -233,13 +233,12 @@ function resourcelib_embed_pdf($fullurl, $title, $clicktoopen) {
|
||||||
global $CFG, $PAGE;
|
global $CFG, $PAGE;
|
||||||
|
|
||||||
$code = <<<EOT
|
$code = <<<EOT
|
||||||
<div class="resourcecontent resourcepdf">
|
<div class="resourcecontent resourcepdf">
|
||||||
<object id="resourceobject" data="$fullurl" type="application/pdf" width="800" height="600">
|
<iframe id="resourceobject" src="$fullurl" title="$title" width="800" height="600">
|
||||||
<param name="src" value="$fullurl" />
|
|
||||||
$clicktoopen
|
$clicktoopen
|
||||||
</object>
|
</iframe>
|
||||||
</div>
|
</div>
|
||||||
EOT;
|
EOT;
|
||||||
|
|
||||||
// the size is hardcoded in the boject obove intentionally because it is adjusted by the following function on-the-fly
|
// 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);
|
$PAGE->requires->js_init_call('M.util.init_maximised_embed', array('resourceobject'), true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue