]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10021: display iframe when the resource is on another domain, merged from 19
authorjerome <jerome>
Tue, 4 Nov 2008 05:19:01 +0000 (05:19 +0000)
committerjerome <jerome>
Tue, 4 Nov 2008 05:19:01 +0000 (05:19 +0000)
mod/resource/type/file/resource.class.php

index 5e2e5828281e5d7d7ee7ab4bd763ba5d7d55f08d..345dcb1ca6caf5fa182c71d1316db710d007e52a 100644 (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[