Skip to content
Browse files

file resources: MDL-14541 Object tag embedding PDF's and nested Flash…

… objects does not work reliably

Merged from MOODLE_19_STABLE.

Credit goes to David Boyer for reporting and suggesting the fix for PDF files,
and Jon Witts & Mauno Korpelainen for proving a way to reproduce the Flash
issue and tips to fix it.
  • Loading branch information...
1 parent c589f05 commit 55e92195baa000cdb53ab30dd61542e7a72ebdd1 iarenaza committed Nov 15, 2008
Showing with 3 additions and 0 deletions.
  1. +3 −0 mod/resource/type/file/resource.class.php
View
3 mod/resource/type/file/resource.class.php
@@ -634,12 +634,14 @@ function resizeEmbeddedHtml() {
echo '<param name="loop" value="true" />';
echo '<param name="controller" value="true" />';
echo '<param name="scale" value="aspect" />';
+ echo '<param name="base" value="." />';
echo '<!--[if !IE]>-->';
echo "<object type=\"application/x-shockwave-flash\" data=\"$fullurl\">";
echo '<param name="controller" value="true" />';
echo '<param name="autoplay" value="true" />';
echo '<param name="loop" value="true" />';
echo '<param name="scale" value="aspect" />';
+ echo '<param name="base" value="." />';
echo '<!--<![endif]-->';
echo '<a href="' . $fullurl . '">' . $fullurl . '</a>';
echo '<!--[if !IE]>-->';
@@ -656,6 +658,7 @@ function resizeEmbeddedHtml() {
} elseif ($resourcetype == 'pdf') {
echo '<div class="resourcepdf">';
echo '<object data="' . $fullurl . '" type="application/pdf">';
+ echo '<param name="src" value="' . $fullurl . '" />';
echo get_string('clicktoopen', 'resource') . '<a href="' . $fullurl . '">' . format_string($resource->name) . '</a>';
echo '</object>';
echo '</div>';

0 comments on commit 55e9219

Please sign in to comment.
Something went wrong with that request. Please try again.