MDL-30901 mod_chat Removing screenreader setting usage
authorDavid Monllao <davidm@moodle.com>
Mon, 17 Sep 2012 03:29:56 +0000 (11:29 +0800)
committerDavid Monllao <davidm@moodle.com>
Fri, 21 Sep 2012 01:22:21 +0000 (09:22 +0800)
mod/chat/lib.php
mod/chat/view.php

index 9b56981..fa346b9 100644 (file)
@@ -1203,7 +1203,7 @@ function chat_supports($feature) {
 }
 
 function chat_extend_navigation($navigation, $course, $module, $cm) {
-    global $CFG, $USER, $PAGE, $OUTPUT;
+    global $CFG;
 
     $currentgroup = groups_get_activity_group($cm, true);
 
@@ -1219,12 +1219,9 @@ function chat_extend_navigation($navigation, $course, $module, $cm) {
 
         $links = array();
 
-        // If user is using screenreader, display gui_basic gui link only
-        if (empty($USER->screenreader)) {
-            $url = new moodle_url($target.'gui_'.$CFG->chat_method.'/index.php', $params);
-            $action = new popup_action('click', $url, 'chat'.$course->id.$cm->instance.$currentgroup, array('height' => 500, 'width' => 700));
-            $links[] = new action_link($url, $strenterchat, $action);
-        }
+        $url = new moodle_url($target.'gui_'.$CFG->chat_method.'/index.php', $params);
+        $action = new popup_action('click', $url, 'chat'.$course->id.$cm->instance.$currentgroup, array('height' => 500, 'width' => 700));
+        $links[] = new action_link($url, $strenterchat, $action);
 
         $url = new moodle_url($target.'gui_basic/index.php', $params);
         $action = new popup_action('click', $url, 'chat'.$course->id.$cm->instance.$currentgroup, array('height' => 500, 'width' => 700));
index 7567de0..4daae97 100644 (file)
@@ -126,18 +126,12 @@ if (has_capability('mod/chat:chat', $context)) {
         echo '</p>';
     }
 
-    if (empty($USER->screenreader)) {
-        $params['id'] = $chat->id;
-        $chattarget = new moodle_url("/mod/chat/gui_$CFG->chat_method/index.php", $params);
-        echo '<p>';
-        echo $OUTPUT->action_link($chattarget, $strenterchat, new popup_action('click', $chattarget, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700)));
-        echo '</p>';
-    }
+    $params['id'] = $chat->id;
+    $chattarget = new moodle_url("/mod/chat/gui_$CFG->chat_method/index.php", $params);
+    echo '<p>';
+    echo $OUTPUT->action_link($chattarget, $strenterchat, new popup_action('click', $chattarget, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700)));
+    echo '</p>';
 
-    // if user is using screen reader, then there is no need to display this link again
-    // users with screenreader set, will only see 1 link, to the manual refresh page
-    // for better accessibility
-    // show frame/js-less alternative
     $params['id'] = $chat->id;
     $link = new moodle_url('/mod/chat/gui_basic/index.php', $params);
     $action = new popup_action('click', $link, "chat{$course->id}{$chat->id}{$groupparam}", array('height' => 500, 'width' => 700));