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",