Skip to content

Commit

Permalink
MDL-30901 mod_chat Removing screenreader setting usage
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Sep 21, 2012
1 parent 13cd661 commit 36ab2fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
11 changes: 4 additions & 7 deletions mod/chat/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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));
Expand Down
16 changes: 5 additions & 11 deletions mod/chat/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,12 @@
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));
Expand Down

0 comments on commit 36ab2fe

Please sign in to comment.