From b5828a96a53756bdd21e9793a66c1f095c1f4f25 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Tue, 12 Dec 2006 03:39:14 +0000 Subject: [PATCH] fix for MDL-7862, frames titles and frame accessibility for resources --- mod/resource/type/file/resource.class.php | 10 +++++----- mod/resource/type/ims/resource.class.php | 2 +- mod/resource/type/repository/resource.class.php | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index ca0d84b45f..4ce58c8284 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -186,7 +186,7 @@ function update_instance($resource) { * @param CFG global object */ function display() { - global $CFG, $THEME; + global $CFG, $THEME, $USER; /// Set up generic stuff first, including checking for access parent::display(); @@ -349,7 +349,7 @@ function display() { /// Now check whether we need to display a frameset $frameset = optional_param( 'frameset','' ); - if (empty($frameset) and !$embedded and !$inpopup and ($resource->options == "frame")) { + if (empty($frameset) and !$embedded and !$inpopup and ($resource->options == "frame") and !$USER->screenreader) { @header('Content-Type: text/html; charset=utf-8'); echo "\n"; echo "\n"; @@ -357,11 +357,11 @@ function display() { echo ''; echo "{$course->shortname}: ".strip_tags(format_string($resource->name,true))."\n"; echo "resource_framesize,*\">"; - echo "id}&type={$resource->type}&frameset=top\" />"; + 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\" />"; + echo "id}&type={$resource->type}&inpopup=true\" title=\"".get_string('modulename','resource')."\"/>"; } else { - echo ""; + echo ""; } echo ""; echo ""; diff --git a/mod/resource/type/ims/resource.class.php b/mod/resource/type/ims/resource.class.php index cf4a0565bc..d38ac4080e 100644 --- a/mod/resource/type/ims/resource.class.php +++ b/mod/resource/type/ims/resource.class.php @@ -549,7 +549,7 @@ class resource_ims extends resource_base { } /// prints iframe filled with $fullurl - echo ""; //Content frame + echo ""; //Content frame echo ''; } diff --git a/mod/resource/type/repository/resource.class.php b/mod/resource/type/repository/resource.class.php index af103baaf8..f698fd5cf2 100644 --- a/mod/resource/type/repository/resource.class.php +++ b/mod/resource/type/repository/resource.class.php @@ -333,18 +333,18 @@ function display() { /// Now check whether we need to display a frameset - if (empty($_GET['frameset']) and !$embedded and !$inpopup and $resource->options == "frame") { + if (empty($_GET['frameset']) and !$embedded and !$inpopup and $resource->options == "frame" and !$USER->screenreader) { echo "\n"; echo "\n"; echo ''; echo ''; echo "{$course->shortname}: ".strip_tags(format_string($resource->name,true))."\n"; echo "resource_framesize,*\">"; - echo "id}&type={$resource->type}&frameset=top\" />"; + 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\" />"; + echo "id}&type={$resource->type}&inpopup=true\" title=\"".get_string('modulename','resource')."\"/>"; } else { - echo ""; + echo ""; } echo ""; echo ""; -- 2.39.5