if ($category->can_change_sortorder()) {
$actions['moveup'] = array(
'url' => new \moodle_url($baseurl, array('action' => 'movecategoryup')),
- 'icon' => new \pix_icon('t/up', new \lang_string('up')),
- 'string' => new \lang_string('up')
+ 'icon' => new \pix_icon('t/up', new \lang_string('moveup')),
+ 'string' => new \lang_string('moveup')
);
$actions['movedown'] = array(
'url' => new \moodle_url($baseurl, array('action' => 'movecategorydown')),
- 'icon' => new \pix_icon('t/down', new \lang_string('down')),
- 'string' => new \lang_string('down')
+ 'icon' => new \pix_icon('t/down', new \lang_string('movedown')),
+ 'string' => new \lang_string('movedown')
);
}
*
* @param \core_course_category $category
* @param \core_course_list_element $course
- * @return string
+ * @return array
*/
public static function get_course_listitem_actions(\core_course_category $category, \core_course_list_element $course) {
$baseurl = new \moodle_url(
if ($category->can_resort_courses()) {
$actions[] = array(
'url' => new \moodle_url($baseurl, array('action' => 'movecourseup')),
- 'icon' => new \pix_icon('t/up', \get_string('up')),
+ 'icon' => new \pix_icon('t/up', \get_string('moveup')),
'attributes' => array('data-action' => 'moveup', 'class' => 'action-moveup')
);
$actions[] = array(
'url' => new \moodle_url($baseurl, array('action' => 'movecoursedown')),
- 'icon' => new \pix_icon('t/down', \get_string('down')),
+ 'icon' => new \pix_icon('t/down', \get_string('movedown')),
'attributes' => array('data-action' => 'movedown', 'class' => 'action-movedown')
);
}
$categoryid = '';
}
$select = new single_select($this->page->url, 'categoryid', $categories, $categoryid, $nothing);
+ $select->attributes['aria-label'] = get_string('selectacategory');
$html .= $this->render($select);
}
$html .= html_writer::end_div();
$html .= html_writer::start_div('float-left ' . $checkboxclass);
$html .= html_writer::start_div('custom-control custom-checkbox mr-1 ');
$html .= html_writer::empty_tag('input', $bcatinput);
- $html .= html_writer::tag('label', '', array(
- 'aria-label' => get_string('bulkactionselect', 'moodle', $text),
+ $labeltext = html_writer::span(get_string('bulkactionselect', 'moodle', $text), 'sr-only');
+ $html .= html_writer::tag('label', $labeltext, array(
'class' => 'custom-control-label',
'for' => 'categorylistitem' . $category->id));
$html .= html_writer::end_div();
$html .= html_writer::start_div('card-body');
$html .= $this->course_listing_actions($category, $course, $perpage);
$html .= $this->listing_pagination($category, $page, $perpage, false, $viewmode);
- $html .= html_writer::start_tag('ul', array('class' => 'ml course-list', 'role' => 'group'));
+ $html .= html_writer::start_tag('ul', array('class' => 'ml course-list'));
foreach ($category->get_courses($options) as $listitem) {
$html .= $this->course_listitem($category, $listitem, $courseid);
}
$html .= html_writer::start_div('float-left ' . $checkboxclass);
$html .= html_writer::start_div('custom-control custom-checkbox mr-1 ');
$html .= html_writer::empty_tag('input', $bulkcourseinput);
- $html .= html_writer::tag('label', '', array(
- 'aria-label' => get_string('bulkactionselect', 'moodle', $text),
+ $labeltext = html_writer::span(get_string('bulkactionselect', 'moodle', $text), 'sr-only');
+ $html .= html_writer::tag('label', $labeltext, array(
'class' => 'custom-control-label',
'for' => 'courselistitem' . $course->id));
$html .= html_writer::end_div();
if ($bulkcourseinput) {
$html .= html_writer::start_div('custom-control custom-checkbox mr-1');
$html .= html_writer::empty_tag('input', $bulkcourseinput);
- $html .= html_writer::tag('label', '', array(
- 'aria-label' => get_string('bulkactionselect', 'moodle', $text),
+ $labeltext = html_writer::span(get_string('bulkactionselect', 'moodle', $text), 'sr-only');
+ $html .= html_writer::tag('label', $labeltext, array(
'class' => 'custom-control-label',
'for' => 'coursesearchlistitem' . $course->id));
$html .= html_writer::end_div();
$output .= html_writer::start_tag('form', array('class' => 'card', 'id' => $formid,
'action' => $searchurl, 'method' => 'get'));
$output .= html_writer::start_tag('fieldset', array('class' => 'coursesearchbox invisiblefieldset'));
- $output .= html_writer::tag('div', $this->output->heading($strsearchcourses.': ', 2, 'm-0'),
+ $output .= html_writer::tag('legend', $this->output->heading($strsearchcourses.': ', 2, 'm-0'),
array('class' => 'card-header'));
$output .= html_writer::start_div('card-body');
$output .= html_writer::start_div('input-group col-sm-6 col-lg-4 m-auto');
$output .= html_writer::empty_tag('input', array('class' => 'form-control', 'type' => 'text', 'id' => $inputid,
- 'size' => $inputsize, 'name' => 'search', 'value' => s($value)));
+ 'size' => $inputsize, 'name' => 'search', 'value' => s($value), 'aria-label' => get_string('searchcourses')));
$output .= html_writer::start_tag('span', array('class' => 'input-group-btn'));
$output .= html_writer::tag('button', get_string('go'), array('class' => 'btn btn-primary', 'type' => 'submit'));
$output .= html_writer::end_tag('span');