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.
This commit is contained in:
@@ -637,12 +637,14 @@ class resource_file extends resource_base {
|
||||
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 @@ class resource_file extends resource_base {
|
||||
} 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>';
|
||||
|
||||
Reference in New Issue
Block a user