diff --git a/lang/en_utf8/help/resource/frameifpossible.html b/lang/en_utf8/help/resource/frameifpossible.html index 05b1ee63bec..8950478f194 100644 --- a/lang/en_utf8/help/resource/frameifpossible.html +++ b/lang/en_utf8/help/resource/frameifpossible.html @@ -1,6 +1,8 @@ -
This option will allow the file to be displayed in a frame, so that the Moodle navigation remains on the page in an upper frame.
+This option will allow the file to be displayed in a frame or to be embedded within a navigable page, so that the Moodle navigation remains on the top of the page.
Note that this option is normally not necessary for media types such as movies, audio files and flash files, as without this option turned on they will be embedded within a navigable page.
-Note also that the use of frames can break accessibility, and so this option will be completely ignored if the user has chosen the "Screenreader" option in their profile.
\ No newline at end of file +Note also that the use of frame can break accessibility, and so this option will be completely ignored if the user has chosen the "Screenreader" option in their profile.
+ +Note finally that the use of frame isn't XHTML strict. However the "without frame" option could break some Moodle themes. In conclusion, if the resource is well displayed without frame, prefer this option to the "with frame" option.
\ No newline at end of file diff --git a/lang/en_utf8/resource.php b/lang/en_utf8/resource.php index 50cffef0de7..04ec1c0e31e 100644 --- a/lang/en_utf8/resource.php +++ b/lang/en_utf8/resource.php @@ -59,6 +59,9 @@ $string['imspackageloaded'] = 'Package loaded'; $string['invalidassignment'] = 'incorrect assignment'; $string['invalidid'] = 'Resource ID was incorrect'; $string['keepnavigationvisible'] = 'Keep page navigation visible on the same page'; +$string['keepnavigationvisibleno'] = 'No'; +$string['keepnavigationvisibleyesframe'] = 'Yes, with frame'; +$string['keepnavigationvisibleyesobject'] = 'Yes, without frame'; $string['localfile'] = 'Local file'; $string['localfilechoose'] = 'Choose a local file (CD-ROM)'; $string['localfilehelp'] = 'Help displaying local files'; diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index 53385c79e9a..cadd975e12b 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -153,7 +153,17 @@ class resource_file extends resource_base { if (empty($resource->framepage)) { $resource->options = ''; } else { - $resource->options = 'frame'; + switch ($resource->framepage) { + case 1: + $resource->options = 'frame'; + break; + case 2: + $resource->options = 'objectframe'; + break; + default: + $resource->options = ''; + break; + } } unset($resource->framepage); $resource->popup = ''; @@ -376,73 +386,94 @@ class resource_file extends resource_base { /// Now check whether we need to display a frameset $frameset = optional_param('frameset', '', PARAM_ALPHA); - 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')); + if (empty($frameset) and !$embedded and !$inpopup and ($resource->options == "frame" || $resource->options == "objectframe") and empty($USER->screenreader)) { + /// display the resource into a object tag + if ($resource->options == "objectframe") { + ///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 - $navigation = build_navigation($this->navlinks, $cm); - print_header($pagetitle, $course->fullname, $navigation, "", "", 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 '