From d1881bec562cbfc1be05f8c0542b309bc3881f21 Mon Sep 17 00:00:00 2001 From: Rossiani Wijaya Date: Fri, 27 Jul 2012 18:14:50 +0800 Subject: [PATCH 1/2] MDL-34565 accessibility compliance for forum module: Add forform input text and select tag --- mod/forum/lib.php | 2 ++ mod/forum/search.php | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 921465cd795..fe60d7e7c31 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3842,9 +3842,11 @@ function forum_print_mode_form($id, $mode, $forumtype='') { global $OUTPUT; if ($forumtype == 'single') { $select = new single_select(new moodle_url("/mod/forum/view.php", array('f'=>$id)), 'mode', forum_get_layout_modes(), $mode, null, "mode"); + $select->set_label(get_string('displaymode', 'forum'), array('class' => 'accesshide')); $select->class = "forummode"; } else { $select = new single_select(new moodle_url("/mod/forum/discuss.php", array('d'=>$id)), 'mode', forum_get_layout_modes(), $mode, null, "mode"); + $select->set_label(get_string('displaymode', 'forum'), array('class' => 'accesshide')); } echo $OUTPUT->render($select); } diff --git a/mod/forum/search.php b/mod/forum/search.php index e4a59414a34..fde49b55bb9 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -343,10 +343,15 @@ function forum_print_big_search_form($course) { } echo ' '; - $selectors = html_writer::select_time('days', 'fromday', $datefrom) + $selectors = html_writer::label(get_string('day'), 'menufromday', false, array('class' => 'accesshide')) + . html_writer::select_time('days', 'fromday', $datefrom) + . html_writer::label(get_string('month'), 'menufrommonth', false, array('class' => 'accesshide')) . html_writer::select_time('months', 'frommonth', $datefrom) + . html_writer::label(get_string('year'), 'menufromyear', false, array('class' => 'accesshide')) . html_writer::select_time('years', 'fromyear', $datefrom) + . html_writer::label(get_string('hour'), 'menufromhour', false, array('class' => 'accesshide')) . html_writer::select_time('hours', 'fromhour', $datefrom) + . html_writer::label(get_string('minute'), 'menufromminute', false, array('class' => 'accesshide')) . html_writer::select_time('minutes', 'fromminute', $datefrom); echo $selectors; echo ''; @@ -369,10 +374,15 @@ function forum_print_big_search_form($course) { } echo ' '; - $selectors = html_writer::select_time('days', 'today', $dateto) + $selectors = html_writer::label(get_string('day'), 'menutoday', false, array('class' => 'accesshide')) + . html_writer::select_time('days', 'today', $dateto) + . html_writer::label(get_string('month'), 'menutomonth', false, array('class' => 'accesshide')) . html_writer::select_time('months', 'tomonth', $dateto) + . html_writer::label(get_string('year'), 'menutoyear', false, array('class' => 'accesshide')) . html_writer::select_time('years', 'toyear', $dateto) + . html_writer::label(get_string('hour'), 'menutohour', false, array('class' => 'accesshide')) . html_writer::select_time('hours', 'tohour', $dateto) + . html_writer::label(get_string('minute'), 'menutominute', false, array('class' => 'accesshide')) . html_writer::select_time('minutes', 'tominute', $dateto); echo $selectors; From 73b2ddddaaef55773bfb54cea8caacd2f39e3447 Mon Sep 17 00:00:00 2001 From: Rossiani Wijaya Date: Tue, 7 Aug 2012 15:31:34 +0800 Subject: [PATCH 2/2] MDL-34565: change to plural strings --- mod/forum/search.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mod/forum/search.php b/mod/forum/search.php index fde49b55bb9..ba4472daf58 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -343,15 +343,15 @@ function forum_print_big_search_form($course) { } echo ' '; - $selectors = html_writer::label(get_string('day'), 'menufromday', false, array('class' => 'accesshide')) + $selectors = html_writer::label(get_string('days'), 'menufromday', false, array('class' => 'accesshide')) . html_writer::select_time('days', 'fromday', $datefrom) - . html_writer::label(get_string('month'), 'menufrommonth', false, array('class' => 'accesshide')) + . html_writer::label(get_string('months'), 'menufrommonth', false, array('class' => 'accesshide')) . html_writer::select_time('months', 'frommonth', $datefrom) - . html_writer::label(get_string('year'), 'menufromyear', false, array('class' => 'accesshide')) + . html_writer::label(get_string('years'), 'menufromyear', false, array('class' => 'accesshide')) . html_writer::select_time('years', 'fromyear', $datefrom) - . html_writer::label(get_string('hour'), 'menufromhour', false, array('class' => 'accesshide')) + . html_writer::label(get_string('hours'), 'menufromhour', false, array('class' => 'accesshide')) . html_writer::select_time('hours', 'fromhour', $datefrom) - . html_writer::label(get_string('minute'), 'menufromminute', false, array('class' => 'accesshide')) + . html_writer::label(get_string('minutes'), 'menufromminute', false, array('class' => 'accesshide')) . html_writer::select_time('minutes', 'fromminute', $datefrom); echo $selectors; echo ''; @@ -374,15 +374,15 @@ function forum_print_big_search_form($course) { } echo ' '; - $selectors = html_writer::label(get_string('day'), 'menutoday', false, array('class' => 'accesshide')) + $selectors = html_writer::label(get_string('days'), 'menutoday', false, array('class' => 'accesshide')) . html_writer::select_time('days', 'today', $dateto) - . html_writer::label(get_string('month'), 'menutomonth', false, array('class' => 'accesshide')) + . html_writer::label(get_string('months'), 'menutomonth', false, array('class' => 'accesshide')) . html_writer::select_time('months', 'tomonth', $dateto) - . html_writer::label(get_string('year'), 'menutoyear', false, array('class' => 'accesshide')) + . html_writer::label(get_string('years'), 'menutoyear', false, array('class' => 'accesshide')) . html_writer::select_time('years', 'toyear', $dateto) - . html_writer::label(get_string('hour'), 'menutohour', false, array('class' => 'accesshide')) + . html_writer::label(get_string('hours'), 'menutohour', false, array('class' => 'accesshide')) . html_writer::select_time('hours', 'tohour', $dateto) - . html_writer::label(get_string('minute'), 'menutominute', false, array('class' => 'accesshide')) + . html_writer::label(get_string('minutes'), 'menutominute', false, array('class' => 'accesshide')) . html_writer::select_time('minutes', 'tominute', $dateto); echo $selectors;