]> git.mjollnir.org Git - moodle.git/commitdiff
fix for MDL-7862, frames titles and frame accessibility for resources
authortoyomoyo <toyomoyo>
Tue, 12 Dec 2006 03:39:14 +0000 (03:39 +0000)
committertoyomoyo <toyomoyo>
Tue, 12 Dec 2006 03:39:14 +0000 (03:39 +0000)
mod/resource/type/file/resource.class.php
mod/resource/type/ims/resource.class.php
mod/resource/type/repository/resource.class.php

index ca0d84b45ff98ed3186f659521756a7772b11f17..4ce58c82846102695183fae0f25e6e7d50aed516 100644 (file)
@@ -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 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
         echo "<html dir=\"ltr\">\n";
@@ -357,11 +357,11 @@ function display() {
         echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
         echo "<title>{$course->shortname}: ".strip_tags(format_string($resource->name,true))."</title></head>\n";
         echo "<frameset rows=\"$CFG->resource_framesize,*\">";
-        echo "<frame src=\"view.php?id={$cm->id}&amp;type={$resource->type}&amp;frameset=top\" />";
+        echo "<frame src=\"view.php?id={$cm->id}&amp;type={$resource->type}&amp;frameset=top\" title=\"".get_string('modulename','resource')."\"/>";
         if (!empty($localpath)) {  // Show it like this so we interpose some HTML
-            echo "<frame src=\"view.php?id={$cm->id}&amp;type={$resource->type}&amp;inpopup=true\" />";
+            echo "<frame src=\"view.php?id={$cm->id}&amp;type={$resource->type}&amp;inpopup=true\" title=\"".get_string('modulename','resource')."\"/>";
         } else {
-            echo "<frame src=\"$fullurl\" />";
+            echo "<frame src=\"$fullurl\" title=\"".get_string('modulename','resource')."\"/>";
         }
         echo "</frameset>";
         echo "</html>";
index cf4a0565bcb8c2651b0629cf1e14ba1ca5da94bc..d38ac4080e30b8c4671cb1dda86cbc73c55cd605 100644 (file)
@@ -549,7 +549,7 @@ class resource_ims extends resource_base {
         }
         
     /// prints iframe filled with $fullurl
-        echo "<iframe id=\"".$contentframe."\" name=\"".$contentframe."\" src=\"{$fullurl}\">Your browser does not support inline frames or is currently configured not to display inline frames. Content can be viewed at {$fullurl}</iframe>"; //Content frame
+        echo "<iframe id=\"".$contentframe."\" name=\"".$contentframe."\" src=\"{$fullurl}\" title=\"".get_string('modulename','resource')."\">Your browser does not support inline frames or is currently configured not to display inline frames. Content can be viewed at {$fullurl}</iframe>"; //Content frame
         echo '</div>';
     }
 
index af103baaf84ca7ce4b0b473c6195a8483c3fd4b6..f698fd5cf2277578cf9a4a47e07060e560990ef8 100644 (file)
@@ -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 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
         echo "<html dir=\"ltr\">\n";
         echo '<head>';
         echo '<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />';
         echo "<title>{$course->shortname}: ".strip_tags(format_string($resource->name,true))."</title></head>\n";
         echo "<frameset rows=\"$CFG->resource_framesize,*\">";
-        echo "<frame src=\"view.php?id={$cm->id}&amp;type={$resource->type}&amp;frameset=top\" />";
+        echo "<frame src=\"view.php?id={$cm->id}&amp;type={$resource->type}&amp;frameset=top\" title=\"".get_string('modulename','resource')."\"/>";
         if (!empty($localpath)) {  // Show it like this so we interpose some HTML
-            echo "<frame src=\"view.php?id={$cm->id}&amp;type={$resource->type}&amp;inpopup=true\" />";
+            echo "<frame src=\"view.php?id={$cm->id}&amp;type={$resource->type}&amp;inpopup=true\" title=\"".get_string('modulename','resource')."\"/>";
         } else {
-            echo "<frame src=\"$fullurl\" />";
+            echo "<frame src=\"$fullurl\" title=\"".get_string('modulename','resource')."\"/>";
         }
         echo "</frameset>";
         echo "</html>";