From 13cd661f1be5e85450d9c2088aa3718a2a046711 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 17 Sep 2012 11:26:06 +0800 Subject: [PATCH 1/4] MDL-30901 report_progress Removing screenreader setting usage and adding a title attribute for screen readers --- lib/moodlelib.php | 6 ++---- report/progress/index.php | 5 +++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 2e3460f42e8..0be25d9442a 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -8815,11 +8815,9 @@ function get_browser_version_classes() { * @return bool True for yes, false for no */ function can_use_rotated_text() { - global $USER; - return (check_browser_version('MSIE', 9) || check_browser_version('Firefox', 2) || + return check_browser_version('MSIE', 9) || check_browser_version('Firefox', 2) || check_browser_version('Chrome', 21) || check_browser_version('Safari', 536.25) || - check_browser_version('Opera', 12) || check_browser_version('Safari iOS', 533)) && - !$USER->screenreader; + check_browser_version('Opera', 12) || check_browser_version('Safari iOS', 533); } /** diff --git a/report/progress/index.php b/report/progress/index.php index 7a979dc3053..8997c14f0a2 100644 --- a/report/progress/index.php +++ b/report/progress/index.php @@ -326,12 +326,13 @@ foreach($activities as $activity) { if ($csv) { print $sep.csv_quote(strip_tags($activity->name)).$sep.csv_quote($datetext); } else { + $formattedactivityname = format_string($activity->name, true, array('context' => $context)); print ''. ''. + '/view.php?id='.$activity->id.'" title="' . $formattedactivityname . '">'. ''.
             get_string('modulename',$activity->modname).' '. - format_string($activity->name).''; + $formattedactivityname.''; if ($activity->completionexpected) { print '
'.$datetext.'
'; } From 36ab2fedffee3c46ed8ed71434b34c4dad988568 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 17 Sep 2012 11:29:56 +0800 Subject: [PATCH 2/4] MDL-30901 mod_chat Removing screenreader setting usage --- mod/chat/lib.php | 11 ++++------- mod/chat/view.php | 16 +++++----------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/mod/chat/lib.php b/mod/chat/lib.php index 9b5698155c5..fa346b99854 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -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)); diff --git a/mod/chat/view.php b/mod/chat/view.php index 7567de06a13..4daae972b5f 100644 --- a/mod/chat/view.php +++ b/mod/chat/view.php @@ -126,18 +126,12 @@ if (has_capability('mod/chat:chat', $context)) { echo '

'; } - if (empty($USER->screenreader)) { - $params['id'] = $chat->id; - $chattarget = new moodle_url("/mod/chat/gui_$CFG->chat_method/index.php", $params); - echo '

'; - echo $OUTPUT->action_link($chattarget, $strenterchat, new popup_action('click', $chattarget, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700))); - echo '

'; - } + $params['id'] = $chat->id; + $chattarget = new moodle_url("/mod/chat/gui_$CFG->chat_method/index.php", $params); + echo '

'; + echo $OUTPUT->action_link($chattarget, $strenterchat, new popup_action('click', $chattarget, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700))); + echo '

'; - // 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)); From 19db454f36c746e6010924de75ed63b9f27b939d Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 17 Sep 2012 14:25:45 +0800 Subject: [PATCH 3/4] MDL-30901 gradereport_grader Removing screenreader usage and adding aria elements to grader cells --- grade/report/grader/lib.php | 3 +-- grade/report/grader/module.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index 3f6681e5454..4f14578e1ff 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -615,7 +615,6 @@ class grade_report_grader extends grade_report { $rows = array(); $showuserimage = $this->get_pref('showuserimage'); - $fixedstudents = $this->is_fixed_students(); $strfeedback = $this->get_lang_string("feedback"); $strgrade = $this->get_lang_string('grade'); @@ -1639,7 +1638,7 @@ class grade_report_grader extends grade_report { */ public function is_fixed_students() { global $USER, $CFG; - return empty($USER->screenreader) && $CFG->grade_report_fixedstudents && + return $CFG->grade_report_fixedstudents && (check_browser_version('MSIE', '7.0') || check_browser_version('Firefox', '2.0') || check_browser_version('Gecko', '2006010100') || diff --git a/grade/report/grader/module.js b/grade/report/grader/module.js index 800f5541c03..0ee92bae4b4 100644 --- a/grade/report/grader/module.js +++ b/grade/report/grader/module.js @@ -56,7 +56,7 @@ M.gradereport_grader = { return; } - var content = '
'; + var content = '