"; $posthref = ""; $newcontent = str_replace($prehref, $posthref, $newcontent); if (CheckSubFolder($full_file_path.$user_id.'.t.html') == 0) { $newcontent = ReplaceImgTag($newcontent); } } else { $newcontent = $content; } WriteFileCont($full_file_path.$user_id.'.t.html', $newcontent); $doc_url = GetFolderPath($doc_url).urlencode(basename($doc_url)); $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path']."/document"; $my_file = Security::remove_XSS($_GET['file']); $my_file = str_replace(['../', '\\..', '\\0', '..\\'], ['', '', '', ''], urldecode($my_file)); $title = GetQuizName($my_file, $documentPath); if ($title == '') { $title = basename($my_file); } $nameTools = $title; $htmlHeadXtra[] = << function setHeight() { var iframe = document.getElementById('hotpotatoe'); iframe.height = 800; var maxheight = $(iframe.contentDocument.body).outerHeight(true); iframe.height = maxheight $(iframe.contentDocument.body).children().each(function() { // If this elements height is bigger than the biggestHeight var tempheight = $(this)["0"].offsetHeight + $(this)["0"].offsetTop; if (tempheight > maxheight) { // Set the maxheight to this Height maxheight = tempheight; } }); iframe.height = maxheight; } $(function() { var iframe = document.getElementById('hotpotatoe'); iframe.onload = function () { // this.height = $(this.contentDocument.body).outerHeight(true) setTimeout(function(){ setHeight(); }, 1750); }; }); HTML; $interbreadcrumb[] = ["url" => './exercise.php?'.api_get_cidreq(), 'name' => get_lang('Exercises')]; if ($origin == 'learnpath') { Display::display_reduced_header($nameTools, "Exercise"); } else { Display::display_header($nameTools, "Exercise"); } $url = $document_web_path.$doc_url.$user_id.'.t.html?time='.intval($time); echo ''; if ($origin == 'learnpath') { Display::display_reduced_footer(); } else { Display::display_footer(); }