# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: moodle/mod/resource/type/file/resource.class.php --- moodle/mod/resource/type/file/resource.class.php Base (1.53.2.19) +++ moodle/mod/resource/type/file/resource.class.php Locally Modified (Based On 1.53.2.19) @@ -371,22 +371,72 @@ $frameset = optional_param('frameset', '', PARAM_ALPHA); if (empty($frameset) and !$embedded and !$inpopup and ($resource->options == "frame") and empty($USER->screenreader)) { - @header('Content-Type: text/html; charset=utf-8'); - echo "\n"; - echo "\n"; - echo ''; - echo ''; - echo "" . format_string($course->shortname) . ": ".strip_tags(format_string($resource->name,true))."\n"; - echo "resource_framesize,*\">"; - echo "id}&type={$resource->type}&frameset=top\" title=\"".get_string('modulename','resource')."\"/>"; - if (!empty($localpath)) { // Show it like this so we interpose some HTML - echo "id}&type={$resource->type}&inpopup=true\" title=\"".get_string('modulename','resource')."\"/>"; - } else { - echo ""; + if ($mimetype != "text/html") { + @header('Content-Type: text/html; charset=utf-8'); + echo "\n"; + echo "\n"; + echo ''; + echo ''; + echo "" . format_string($course->shortname) . ": ".strip_tags(format_string($resource->name,true))."\n"; + echo "resource_framesize,*\">"; + echo "id}&type={$resource->type}&frameset=top\" title=\"".get_string('modulename','resource')."\"/>"; + if (!empty($localpath)) { // Show it like this so we interpose some HTML + echo "id}&type={$resource->type}&inpopup=true\" title=\"".get_string('modulename','resource')."\"/>"; + } else { + echo ""; + } + echo ""; + echo ""; + exit; } - echo ""; - echo ""; - exit; + //If it's an HTML file so we embed it as an object tag (no frame use in order to valid strict XHTML) + //this case has been created for MDL-10021 + else { + //Yahoo javascript libaries for updating embedded object size + require_js(array('yui_utilities')); + require_js(array('yui_container')); + require_js(array('yui_dom-event')); + require_js(array('yui_dom')); + + //Moodle Header and navigation bar + print_header($pagetitle, $course->fullname, "$this->navigation ".format_string($resource->name), "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "parent")); + $options = new object(); + $options->para = false; + if (!empty($localpath)) { // Show some help + echo ''; + } + echo ''; + + //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 ' + '; + + //print the summary + print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $course->id), "center"); + echo ""; + exit; + } }