Permalink
Browse files

MDL-34571 accessibility compliance for report: Add label to select an…

…d input text form
  • Loading branch information...
1 parent 4db3699 commit cfaf6a18b91225d0c036aba20f5f21ec2a282df9 Rossiani Wijaya committed Aug 17, 2012
@@ -75,12 +75,15 @@
$table->width = '*';
$table->align = array('left','left','left','left','left','left');
-$reporttypemenu = html_writer::select($reportoptions,'report',$report, false);
-$timeoptionsmenu = html_writer::select($timeoptions,'time',$time, false);
+$reporttypemenu = html_writer::label(get_string('statsreporttype'), 'menureport', false, array('class' => 'accesshide'));
+$reporttypemenu .= html_writer::select($reportoptions,'report',$report, false);
+$timeoptionsmenu = html_writer::label(get_string('time'), 'menutime', false, array('class' => 'accesshide'));
+$timeoptionsmenu .= html_writer::select($timeoptions,'time',$time, false);
$table->data[] = array(get_string('statsreporttype'),$reporttypemenu,
get_string('statstimeperiod'),$timeoptionsmenu,
- '<input type="text" name="numcourses" size="3" maxlength="2" value="'.$numcourses.'" />',
+ '<label class="accesshide" for="numcourses">' . get_string('numberofcourses') . '</label>' .
+ '<input type="text" id="numcourses" name="numcourses" size="3" maxlength="2" value="'.$numcourses.'" />',
'<input type="submit" value="'.get_string('view').'" />') ;
echo html_writer::table($table);
@@ -25,6 +25,7 @@
$string['log:view'] = 'View course logs';
$string['log:viewtoday'] = 'View today\'s logs';
+$string['logsformat'] = 'Logs format';
$string['page-report-log-x'] = 'Any log report';
$string['page-report-log-index'] = 'Course log report';
$string['page-report-log-user'] = 'User course log report';
View
@@ -270,10 +270,12 @@ function report_log_print_mnet_selector_form($hostid, $course, $selecteduser=0,
echo "<input type=\"hidden\" name=\"showcourses\" value=\"$showcourses\" />\n";
if (has_capability('report/log:view', $sitecontext) && $showcourses) {
$cid = empty($course->id)? '1' : $course->id;
+ echo html_writer::label(get_string('selectacoursesite'), 'menuhost_course', false, array('class' => 'accesshide'));
echo html_writer::select($dropdown, "host_course", $hostid.'/'.$cid);
} else {
$courses = array();
$courses[$course->id] = $course->fullname . ((empty($course->category)) ? ' ('.get_string('site').') ' : '');
+ echo html_writer::label(get_string('selectacourse'), 'menuid', false, array('class' => 'accesshide'));
echo html_writer::select($courses,"id",$course->id, false);
if (has_capability('report/log:view', $sitecontext)) {
$a = new stdClass();
@@ -292,10 +294,12 @@ function report_log_print_mnet_selector_form($hostid, $course, $selecteduser=0,
else {
$groups = array();
}
+ echo html_writer::label(get_string('selectagroup'), 'menugroup', false, array('class' => 'accesshide'));
echo html_writer::select($groups, "group", $selectedgroup, get_string("allgroups"));
}
if ($showusers) {
+ echo html_writer::label(get_string('participantslist'), 'menuuser', false, array('class' => 'accesshide'));
echo html_writer::select($users, "user", $selecteduser, get_string("allparticipants"));
}
else {
@@ -307,20 +311,25 @@ function report_log_print_mnet_selector_form($hostid, $course, $selecteduser=0,
else {
$users[0] = get_string('allparticipants');
}
+ echo html_writer::label(get_string('participantslist'), 'menuuser', false, array('class' => 'accesshide'));
echo html_writer::select($users, "user", $selecteduser, false);
$a->url = "$CFG->wwwroot/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser"
."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showusers=1&showcourses=$showcourses";
print_string('logtoomanyusers','moodle',$a);
}
+ echo html_writer::label(get_string('date'), 'menudate', false, array('class' => 'accesshide'));
echo html_writer::select($dates, "date", $selecteddate, get_string("alldays"));
+ echo html_writer::label(get_string('showreports'), 'menumodid', false, array('class' => 'accesshide'));
echo html_writer::select($activities, "modid", $selectedactivity, get_string("allactivities"));
+ echo html_writer::label(get_string('actions'), 'menumodaction', false, array('class' => 'accesshide'));
echo html_writer::select($actions, 'modaction', $modaction, get_string("allactions"));
$logformats = array('showashtml' => get_string('displayonpage'),
'downloadascsv' => get_string('downloadtext'),
'downloadasods' => get_string('downloadods'),
'downloadasexcel' => get_string('downloadexcel'));
+ echo html_writer::label(get_string('logsformat', 'report_log'), 'menulogformat', false, array('class' => 'accesshide'));
echo html_writer::select($logformats, 'logformat', $logformat, false);
echo '<input type="submit" value="'.get_string('gettheselogs').'" />';
echo '</div>';
@@ -487,11 +496,13 @@ function report_log_print_selector_form($course, $selecteduser=0, $selecteddate=
echo "<input type=\"hidden\" name=\"showusers\" value=\"$showusers\" />\n";
echo "<input type=\"hidden\" name=\"showcourses\" value=\"$showcourses\" />\n";
if (has_capability('report/log:view', $sitecontext) && $showcourses) {
+ echo html_writer::label(get_string('selectacourse'), 'menuid', false, array('class' => 'accesshide'));
echo html_writer::select($courses, "id", $course->id, false);
} else {
// echo '<input type="hidden" name="id" value="'.$course->id.'" />';
$courses = array();
$courses[$course->id] = $course->fullname . (($course->id == SITEID) ? ' ('.get_string('site').') ' : '');
+ echo html_writer::label(get_string('selectacourse'), 'menuid', false, array('class' => 'accesshide'));
echo html_writer::select($courses,"id",$course->id, false);
if (has_capability('report/log:view', $sitecontext)) {
$a = new stdClass();
@@ -510,10 +521,12 @@ function report_log_print_selector_form($course, $selecteduser=0, $selecteddate=
else {
$groups = array();
}
+ echo html_writer::label(get_string('selectagroup'), 'menugroup', false, array('class' => 'accesshide'));
echo html_writer::select($groups, "group", $selectedgroup, get_string("allgroups"));
}
if ($showusers) {
+ echo html_writer::label(get_string('selctauser'), 'menuuser', false, array('class' => 'accesshide'));
echo html_writer::select($users, "user", $selecteduser, get_string("allparticipants"));
}
else {
@@ -525,22 +538,27 @@ function report_log_print_selector_form($course, $selecteduser=0, $selecteddate=
else {
$users[0] = get_string('allparticipants');
}
+ echo html_writer::label(get_string('selctauser'), 'menuuser', false, array('class' => 'accesshide'));
echo html_writer::select($users, "user", $selecteduser, false);
$a = new stdClass();
$a->url = "$CFG->wwwroot/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser"
."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showusers=1&showcourses=$showcourses";
print_string('logtoomanyusers','moodle',$a);
}
+ echo html_writer::label(get_string('date'), 'menudate', false, array('class' => 'accesshide'));
echo html_writer::select($dates, "date", $selecteddate, get_string("alldays"));
+ echo html_writer::label(get_string('activities'), 'menumodid', false, array('class' => 'accesshide'));
echo html_writer::select($activities, "modid", $selectedactivity, get_string("allactivities"));
+ echo html_writer::label(get_string('actions'), 'menumodaction', false, array('class' => 'accesshide'));
echo html_writer::select($actions, 'modaction', $modaction, get_string("allactions"));
$logformats = array('showashtml' => get_string('displayonpage'),
'downloadascsv' => get_string('downloadtext'),
'downloadasods' => get_string('downloadods'),
'downloadasexcel' => get_string('downloadexcel'));
+ echo html_writer::label(get_string('logsformat', 'report_log'), 'menulogformat', false, array('class' => 'accesshide'));
echo html_writer::select($logformats, 'logformat', $logformat, false);
echo '<input type="submit" value="'.get_string('gettheselogs').'" />';
echo '</div>';
@@ -311,7 +311,7 @@
}
echo '</div>';
echo '<div>';
- echo '<label for="formaction">'.get_string('withselectedusers').'</label>';
+ echo '<label for="formactionselect">'.get_string('withselectedusers').'</label>';
$displaylist['messageselect.php'] = get_string('messageselectadd');
echo html_writer::select($displaylist, 'formaction', '', array(''=>'choosedots'), array('id'=>'formactionselect'));
echo $OUTPUT->help_icon('withselectedusers');
View
@@ -46,6 +46,7 @@ function report_stats_mode_menu($course, $mode, $time, $url) {
}
$popupurl = $url."?course=$course->id&time=$time";
$select = new single_select(new moodle_url($popupurl), 'mode', $options, $mode, null);
+ $select->set_label(get_string('reports'), array('class' => 'accesshide'));
$select->formid = 'switchmode';
return $OUTPUT->render($select);
}
@@ -126,21 +127,21 @@ function report_stats_report($course, $report, $mode, $user, $roleid, $time) {
}
$table->align = array('left','left','left','left','left','left','left','left');
- $table->data[] = array(get_string('course'),html_writer::select($courseoptions,'course',$course->id,false),
- get_string('users'),html_writer::select($users,'userid',$userid,false),
- get_string('statsreporttype'),html_writer::select($reportoptions,'report',($report == 5) ? $report.$roleid : $report,false),
- get_string('statstimeperiod'),html_writer::select($timeoptions,'time',$time,false),
+ $table->data[] = array(html_writer::label(get_string('course'), 'menucourse'), html_writer::select($courseoptions, 'course', $course->id, false),
+ html_writer::label(get_string('users'), 'menuuserid'), html_writer::select($users, 'userid', $userid, false),
+ html_writer::label(get_string('statsreporttype'), 'menureport'), html_writer::select($reportoptions,'report',($report == 5) ? $report.$roleid : $report,false),
+ html_writer::label(get_string('statstimeperiod'), 'menutime') ,html_writer::select($timeoptions,'time',$time,false),
'<input type="submit" value="'.get_string('view').'" />') ;
} else if ($mode == STATS_MODE_RANKED) {
$table->align = array('left','left','left','left','left','left');
- $table->data[] = array(get_string('statsreporttype'),html_writer::select($reportoptions,'report',($report == 5) ? $report.$roleid : $report,false),
- get_string('statstimeperiod'),html_writer::select($timeoptions,'time',$time,false),
+ $table->data[] = array(html_writer::label(get_string('statsreporttype'), 'menureport'), html_writer::select($reportoptions,'report',($report == 5) ? $report.$roleid : $report,false),
+ html_writer::label(get_string('statstimeperiod'), 'menutime'), html_writer::select($timeoptions,'time',$time,false),
'<input type="submit" value="'.get_string('view').'" />') ;
} else if ($mode == STATS_MODE_GENERAL) {
$table->align = array('left','left','left','left','left','left','left');
- $table->data[] = array(get_string('course'),html_writer::select($courseoptions,'course',$course->id,false),
- get_string('statsreporttype'),html_writer::select($reportoptions,'report',($report == 5) ? $report.$roleid : $report,false),
- get_string('statstimeperiod'),html_writer::select($timeoptions,'time',$time,false),
+ $table->data[] = array(html_writer::label(get_string('course'), 'menucourse'), html_writer::select($courseoptions,'course',$course->id,false),
+ html_writer::label(get_string('statsreporttype'), 'menureport'), html_writer::select($reportoptions,'report',($report == 5) ? $report.$roleid : $report,false),
+ html_writer::label(get_string('statstimeperiod'), 'menutime'), html_writer::select($timeoptions,'time',$time,false),
'<input type="submit" value="'.get_string('view').'" />') ;
}

0 comments on commit cfaf6a1

Please sign in to comment.