Fixing empty frame in IE7 see #3343

skala
Julio Montoya 14 years ago
parent 38bf82d72d
commit 355abb180b
  1. 54
      main/exercice/showinframes.php

@ -13,7 +13,6 @@ require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/hotpotatoes.lib.php';
$time = time();
$doc_url = str_replace(array('../', '\\', '\\0', '..'), array('', '', '', ''), urldecode($_GET['file']));
$cid = api_get_course_id();
$document_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
@ -33,8 +32,8 @@ if ($content == '') {
$mit = "function Finish(){";
$js_content = "
//Code added - start
var SaveScoreVariable = 0;
function mySaveScore() {
var SaveScoreVariable = 0;
function mySaveScore() {
if (SaveScoreVariable==0) {
SaveScoreVariable = 1;
if (C.ie) {
@ -44,7 +43,7 @@ if ($content == '') {
window.location.href = '".api_get_path(WEB_PATH)."main/exercice/savescores.php?origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score;
}
}
}
}
function Finish(){
mySaveScore();
//Code added - end
@ -58,10 +57,11 @@ if ($content == '') {
if (CheckSubFolder($full_file_path.$user_id.'.t.html') == 0) {
$newcontent = ReplaceImgTag($newcontent);
}
} else {
} else {
$newcontent = $content;
}
WriteFileCont($full_file_path.$user_id.'.t.html', $newcontent);
$doc_url = GetFolderPath($doc_url).urlencode(basename($doc_url));
@ -81,15 +81,15 @@ if (isset($_SESSION['gradebook'])){
if (!empty($gradebook) && $gradebook=='view') {
$interbreadcrumb[]= array (
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook')
);
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook')
);
}
$htmlHeadXtra[] = '
$htmlHeadXtra[] = '
<script>
var height = window.innerHeight;
$(document).ready( function(){
$("iframe").css("height", height)
var height = $(this).innerHeight() - 20;
$("#hotpotatoe").css("height", height)
});
</script>';
@ -100,32 +100,6 @@ if ($origin == 'learnpath') {
Display::display_header($nameTools,"Exercise");
}
$url = $document_web_path.$doc_url.$user_id.'.t.html?time='.Security::remove_XSS($time);
echo '<iframe id="hotpotatoe" width="100%" frameborder="0" src="'.$url.'"><iframe>';
exit;
if ($origin!='learnpath') {
?>
<frameset rows="<?php echo $header_height; ?>,*" border="0" frameborder="no">
<frame name="top" scrolling="no" noresize target="contents" src="testheaderpage.php?file=<?php echo Security::remove_XSS(str_replace(array('../','\\','\\0','..'),array('','','',''),urldecode($_GET['file']))); ?>">
<frame name="main" src="<?php echo $document_web_path.$doc_url.$user_id.'.t.html?time='.Security::remove_XSS($time); ?>">
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.
We suggest you try Mozilla, Firebird, Safari, Opera, or other browsers updated this millenium.
</p>
</body>
</noframes>
</frameset>
<?php
} else {
?>
<script>
s='<?php echo $document_web_path.$doc_url.$user_id; ?>.t.html?time=<?php echo Security::remove_XSS($time); ?>';
window.location=s;
</script>
<?php
}
?>
</html>
echo '<iframe overflow:hidden id="hotpotatoe" width="100%" frameborder="0" src="'.$url.'"></iframe>';
echo '</body></html>';
exit;
Loading…
Cancel
Save