Permalink
Browse files

Merge branch 'MDL-30769_iframe_m24' of git://github.com/rwijaya/moodl…

…e into MOODLE_24_STABLE
  • Loading branch information...
2 parents 171c3af + feb30ed commit 4ef2160966d35f1ca36eea757468401106ddd662 @danpoltawski danpoltawski committed Jan 21, 2013
Showing with 3 additions and 21 deletions.
  1. +3 −21 lib/resourcelib.php
View
@@ -262,35 +262,17 @@ function resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype) {
$fullurl = $fullurl->out();
}
- $iframe = false;
-
$param = '<param name="src" value="'.$fullurl.'" />';
- // IE can not embed stuff properly, that is why we use iframe instead.
- // Unfortunately this tag does not validate in xhtml strict mode,
- // but in any case it is undeprecated in HTML 5 - we will use it everywhere soon!
- if ($mimetype === 'text/html' and check_browser_version('MSIE', 5)) {
- $iframe = true;
- }
-
- if ($iframe) {
- $code = <<<EOT
+ // Always use iframe embedding because object tag does not work much,
+ // this is ok in HTML5.
+ $code = <<<EOT
<div class="resourcecontent resourcegeneral">
<iframe id="resourceobject" src="$fullurl">
$clicktoopen
</iframe>
</div>
EOT;
- } else {
- $code = <<<EOT
-<div class="resourcecontent resourcegeneral">
- <object id="resourceobject" data="$fullurl" type="$mimetype" width="800" height="600">
- $param
- $clicktoopen
- </object>
-</div>
-EOT;
- }
// the size is hardcoded in the boject obove intentionally because it is adjusted by the following function on-the-fly
$PAGE->requires->js_init_call('M.util.init_maximised_embed', array('resourceobject'), true);

0 comments on commit 4ef2160

Please sign in to comment.