MDL-30901 mod_chat Removing screenreader setting usage

This commit is contained in:
David Monllao 2012-09-17 11:29:56 +08:00
parent 13cd661f1b
commit 36ab2fedff
2 changed files with 9 additions and 18 deletions

View 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));

View 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));