MDL-10021: display iframe when the resource is on another domain, merged from 19

This commit is contained in:
jerome
2008-11-04 05:19:01 +00:00
parent 904998d8f9
commit 74b4fa56d0
+11 -2
View File
@@ -385,12 +385,21 @@ class resource_file extends resource_base {
echo '</div>';
}
echo '</div></div>';
///embedded file into iframe if the resource is on another domain
///
///This case is not XHTML strict but there is no alternative
///The object tag alternative is XHTML strict, however IE6-7 displays a blank object on accross domain by default,
///so we decided to use iframe for accross domain MDL-10021
if (!stristr($fullurl,$CFG->wwwroot)) {
echo '<p><iframe id="embeddedhtml" src ="'.$fullurl.'" width="100%" height="600"></iframe></p>';
}
else {
///embedded HTML file into an object tag
echo '<p><object id="embeddedhtml" data="' . $fullurl . '" type="'.$mimetype.'" width="800" height="600">
alt : <a href="' . $fullurl . '">' . $fullurl . '</a>
</object></p>';
}
///add some javascript in order to fit this object tag into the browser window
echo '<script type="text/javascript">
//<![CDATA[