From bc0b96fc2d8d808a70b02311c386f49074c0f749 Mon Sep 17 00:00:00 2001 From: jerome Date: Fri, 31 Oct 2008 06:04:30 +0000 Subject: [PATCH] MDL-10021: change frame into object tag when display a Link Resource with navigation bar, merged from 19 --- mod/resource/type/file/resource.class.php | 73 +++++++++++++++++------ 1 file changed, 55 insertions(+), 18 deletions(-) diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index c0be52f68a..9a6035b289 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -1,5 +1,6 @@ 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 (empty($frameset) and !$embedded and !$inpopup and ($resource->options == "frame") and empty($USER->screenreader)) { + ///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 ""; - echo ""; - exit; + 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 + if (!empty($resource->summary)) { + print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $course->id), "center"); + } + echo ""; + exit; } -- 2.39.5