Permalink
Browse files

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

… objects does not work reliably

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 dd50f0d commit d430e7feb53c53261149bd418ebfc4ad5c104c70 iarenaza committed Nov 15, 2008
Showing with 3 additions and 0 deletions.
  1. +3 −0 mod/resource/type/file/resource.class.php
@@ -637,12 +637,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]>-->';
@@ -659,6 +661,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 d430e7f

Please sign in to comment.