]> git.mjollnir.org Git - moodle.git/commitdiff
users with screenreader flag set should only see 1 link to manual refresh chat rooms
authortoyomoyo <toyomoyo>
Thu, 4 Jan 2007 01:13:26 +0000 (01:13 +0000)
committertoyomoyo <toyomoyo>
Thu, 4 Jan 2007 01:13:26 +0000 (01:13 +0000)
mod/chat/view.php

index ee107d4300e27fc2d8b4efa3a76d59b5475048d9..edba6aee3c283feb10db6e2fed692347cb8772da 100644 (file)
 
     if (has_capability('mod/chat:chat',$context)) {
         print_simple_box_start('center');
-        link_to_popup_window ("/mod/chat/gui_$CFG->chat_method/index.php?id=$chat->id$groupparam",
+        // users with screenreader set, will only see 1 link, to the manual refresh page
+        // for better accessibility
+        if ($USER->screenreader) {
+            $chattarget = "/mod/chat/gui_basic/index.php?id=$chat->id$groupparam";
+        } else {
+            $chattarget = "/mod/chat/gui_$CFG->chat_method/index.php?id=$chat->id$groupparam"; 
+        }
+        
+        link_to_popup_window ($chattarget,
                               "chat$course->id$chat->id$groupparam", "$strenterchat", 500, 700, get_string('modulename', 'chat'));
         print_simple_box_end();
-        if ($CFG->chat_method == 'header_js') {
+        
+        // if user is using screen reader, then there is no need to display this link again
+        if ($CFG->chat_method == 'header_js' && !$USER->screenreader) {
             // show frame/js-less alternative
             print_simple_box_start('center');
             link_to_popup_window ("/mod/chat/gui_basic/index.php?id=$chat->id$groupparam",