From 74b4fa56d001b0aa34228282cccc1828afe40d67 Mon Sep 17 00:00:00 2001 From: jerome Date: Tue, 4 Nov 2008 05:19:01 +0000 Subject: [PATCH] MDL-10021: display iframe when the resource is on another domain, merged from 19 --- mod/resource/type/file/resource.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index 5e2e582828..345dcb1ca6 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -385,12 +385,21 @@ class resource_file extends resource_base { echo ''; } echo ''; - + + ///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 '

'; + } + else { ///embedded HTML file into an object tag echo '

alt : ' . $fullurl . '

'; - + } ///add some javascript in order to fit this object tag into the browser window echo '