mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
MDL-80192 reportbuilder: ensure filter form group elements have labels.
This ensures compliance with the following WCAG criterion: "H71: Providing a description for groups of form controls using fieldset and legend elements".
This commit is contained in:
parent
9357a1c583
commit
6576b1f9ba
@ -55,7 +55,8 @@ class courserole extends base {
|
|||||||
$elements['course'] = $mform->createElement('text', "{$this->name}_course", get_string('shortnamecourse'));
|
$elements['course'] = $mform->createElement('text', "{$this->name}_course", get_string('shortnamecourse'));
|
||||||
$mform->setType("{$this->name}_course", PARAM_RAW_TRIMMED);
|
$mform->setType("{$this->name}_course", PARAM_RAW_TRIMMED);
|
||||||
|
|
||||||
$mform->addElement('group', "{$this->name}_group", '', $elements, '', false);
|
$mform->addGroup($elements, "{$this->name}_group", $this->get_header(), '', false)
|
||||||
|
->setHiddenLabel(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,6 +50,7 @@ $string['filetypesnotall'] = 'It is not allowed to select \'All file types\' her
|
|||||||
$string['filetypesnotallowed'] = 'These file types are not allowed here: {$a}';
|
$string['filetypesnotallowed'] = 'These file types are not allowed here: {$a}';
|
||||||
$string['filetypesothers'] = 'Other files';
|
$string['filetypesothers'] = 'Other files';
|
||||||
$string['filetypesunknown'] = 'Unknown file types: {$a}';
|
$string['filetypesunknown'] = 'Unknown file types: {$a}';
|
||||||
|
$string['formactions'] = 'Form actions';
|
||||||
$string['general'] = 'General';
|
$string['general'] = 'General';
|
||||||
$string['hideadvanced'] = 'Hide advanced';
|
$string['hideadvanced'] = 'Hide advanced';
|
||||||
$string['hour'] = 'Hour';
|
$string['hour'] = 'Hour';
|
||||||
|
@ -146,9 +146,10 @@ class condition extends dynamic_form {
|
|||||||
$buttons = [];
|
$buttons = [];
|
||||||
$buttons[] = $mform->createElement('submit', 'submitbutton', get_string('apply', 'core_reportbuilder'));
|
$buttons[] = $mform->createElement('submit', 'submitbutton', get_string('apply', 'core_reportbuilder'));
|
||||||
$buttons[] = $mform->createElement('submit', 'resetconditions', get_string('resetall', 'core_reportbuilder'),
|
$buttons[] = $mform->createElement('submit', 'resetconditions', get_string('resetall', 'core_reportbuilder'),
|
||||||
null, null, ['customclassoverride' => 'btn-link']);
|
null, null, ['customclassoverride' => 'btn-link ml-1']);
|
||||||
|
|
||||||
$mform->addGroup($buttons, 'buttonar', '', [' '], false);
|
$mform->addGroup($buttons, 'buttonar', get_string('formactions', 'core_form'), '', false)
|
||||||
|
->setHiddenLabel(true);
|
||||||
$mform->closeHeaderBefore('buttonar');
|
$mform->closeHeaderBefore('buttonar');
|
||||||
|
|
||||||
$mform->disable_form_change_checker();
|
$mform->disable_form_change_checker();
|
||||||
|
@ -149,9 +149,10 @@ class filter extends dynamic_form {
|
|||||||
$buttons = [];
|
$buttons = [];
|
||||||
$buttons[] = $mform->createElement('submit', 'submitbutton', get_string('apply', 'core_reportbuilder'));
|
$buttons[] = $mform->createElement('submit', 'submitbutton', get_string('apply', 'core_reportbuilder'));
|
||||||
$buttons[] = $mform->createElement('submit', 'resetfilters', get_string('resetall', 'core_reportbuilder'),
|
$buttons[] = $mform->createElement('submit', 'resetfilters', get_string('resetall', 'core_reportbuilder'),
|
||||||
null, null, ['customclassoverride' => 'btn-link']);
|
null, null, ['customclassoverride' => 'btn-link ml-1']);
|
||||||
|
|
||||||
$mform->addGroup($buttons, 'buttonar', '', [' '], false);
|
$mform->addGroup($buttons, 'buttonar', get_string('formactions', 'core_form'), '', false)
|
||||||
|
->setHiddenLabel(true);
|
||||||
$mform->closeHeaderBefore('buttonar');
|
$mform->closeHeaderBefore('buttonar');
|
||||||
|
|
||||||
$mform->disable_form_change_checker();
|
$mform->disable_form_change_checker();
|
||||||
|
@ -143,7 +143,8 @@ class date extends base {
|
|||||||
$mform->hideIf("{$this->name}_unit", "{$this->name}_operator", 'in', $typesnounit);
|
$mform->hideIf("{$this->name}_unit", "{$this->name}_operator", 'in', $typesnounit);
|
||||||
|
|
||||||
// Add operator/value/unit group.
|
// Add operator/value/unit group.
|
||||||
$mform->addGroup($elements, "{$this->name}_group", '', '', false);
|
$mform->addGroup($elements, "{$this->name}_group", $this->get_header(), '', false)
|
||||||
|
->setHiddenLabel(true);
|
||||||
|
|
||||||
// Date selectors for range operator.
|
// Date selectors for range operator.
|
||||||
$mform->addElement('date_selector', "{$this->name}_from", get_string('filterdatefrom', 'core_reportbuilder'),
|
$mform->addElement('date_selector', "{$this->name}_from", get_string('filterdatefrom', 'core_reportbuilder'),
|
||||||
|
@ -96,7 +96,8 @@ class duration extends base {
|
|||||||
$mform->setDefault("{$this->name}_unit", 1);
|
$mform->setDefault("{$this->name}_unit", 1);
|
||||||
$mform->hideIf("{$this->name}_unit", "{$this->name}_operator", 'eq', self::DURATION_ANY);
|
$mform->hideIf("{$this->name}_unit", "{$this->name}_operator", 'eq', self::DURATION_ANY);
|
||||||
|
|
||||||
$mform->addGroup($elements, "{$this->name}_group", '', '', false);
|
$mform->addGroup($elements, "{$this->name}_group", $this->get_header(), '', false)
|
||||||
|
->setHiddenLabel(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -100,7 +100,8 @@ class filesize extends base {
|
|||||||
$mform->setDefault("{$this->name}_unit", self::SIZE_UNIT_BYTE);
|
$mform->setDefault("{$this->name}_unit", self::SIZE_UNIT_BYTE);
|
||||||
$mform->hideIf("{$this->name}_unit", "{$this->name}_operator", 'eq', self::ANY_VALUE);
|
$mform->hideIf("{$this->name}_unit", "{$this->name}_operator", 'eq', self::ANY_VALUE);
|
||||||
|
|
||||||
$mform->addElement('group', "{$this->name}_group", '', $elements, '', false);
|
$mform->addGroup($elements, "{$this->name}_group", $this->get_header(), '', false)
|
||||||
|
->setHiddenLabel(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -93,16 +93,16 @@ class number extends base {
|
|||||||
get_string('filterfieldvalue', 'core_reportbuilder', $this->get_header()), ['size' => 3]);
|
get_string('filterfieldvalue', 'core_reportbuilder', $this->get_header()), ['size' => 3]);
|
||||||
$mform->setType($this->name . '_value1', PARAM_INT);
|
$mform->setType($this->name . '_value1', PARAM_INT);
|
||||||
$mform->setDefault($this->name . '_value1', 0);
|
$mform->setDefault($this->name . '_value1', 0);
|
||||||
|
$mform->hideIf($this->name . '_value1', $this->name . '_operator', 'in',
|
||||||
|
[self::ANY_VALUE, self::IS_NOT_EMPTY, self::IS_EMPTY]);
|
||||||
|
|
||||||
$objs['text2'] = $mform->createElement('text', $this->name . '_value2', get_string('to'), ['size' => 3]);
|
$objs['text2'] = $mform->createElement('text', $this->name . '_value2', get_string('to'), ['size' => 3]);
|
||||||
$mform->setType($this->name . '_value2', PARAM_INT);
|
$mform->setType($this->name . '_value2', PARAM_INT);
|
||||||
$mform->setDefault($this->name . '_value2', 0);
|
$mform->setDefault($this->name . '_value2', 0);
|
||||||
|
|
||||||
$mform->addElement('group', $this->name . '_grp', '', $objs, '', false);
|
|
||||||
|
|
||||||
$mform->hideIf($this->name . '_value1', $this->name . '_operator', 'in',
|
|
||||||
[self::ANY_VALUE, self::IS_NOT_EMPTY, self::IS_EMPTY]);
|
|
||||||
$mform->hideIf($this->name . '_value2', $this->name . '_operator', 'noteq', self::RANGE);
|
$mform->hideIf($this->name . '_value2', $this->name . '_operator', 'noteq', self::RANGE);
|
||||||
|
|
||||||
|
$mform->addGroup($objs, $this->name . '_grp', $this->get_header(), '', false)
|
||||||
|
->setHiddenLabel(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -84,7 +84,8 @@ class select extends base {
|
|||||||
$elements['value'] = $mform->createElement($element, $this->name . '_value',
|
$elements['value'] = $mform->createElement($element, $this->name . '_value',
|
||||||
get_string('filterfieldvalue', 'core_reportbuilder', $this->get_header()), $options);
|
get_string('filterfieldvalue', 'core_reportbuilder', $this->get_header()), $options);
|
||||||
|
|
||||||
$mform->addElement('group', $this->name . '_group', '', $elements, '', false);
|
$mform->addGroup($elements, $this->name . '_group', $this->get_header(), '', false)
|
||||||
|
->setHiddenLabel(true);
|
||||||
|
|
||||||
$mform->hideIf($this->name . '_value', $this->name . '_operator', 'eq', self::ANY_VALUE);
|
$mform->hideIf($this->name . '_value', $this->name . '_operator', 'eq', self::ANY_VALUE);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,8 @@ class text extends base {
|
|||||||
$elements['value'] = $mform->createElement('text', $this->name . '_value',
|
$elements['value'] = $mform->createElement('text', $this->name . '_value',
|
||||||
get_string('filterfieldvalue', 'core_reportbuilder', $this->get_header()));
|
get_string('filterfieldvalue', 'core_reportbuilder', $this->get_header()));
|
||||||
|
|
||||||
$mform->addElement('group', $this->name . '_group', '', $elements, '', false);
|
$mform->addGroup($elements, $this->name . '_group', $this->get_header(), '', false)
|
||||||
|
->setHiddenLabel(true);
|
||||||
|
|
||||||
$mform->setType($this->name . '_value', PARAM_RAW_TRIMMED);
|
$mform->setType($this->name . '_value', PARAM_RAW_TRIMMED);
|
||||||
$mform->hideIf($this->name . '_value', $this->name . '_operator', 'eq', self::ANY_VALUE);
|
$mform->hideIf($this->name . '_value', $this->name . '_operator', 'eq', self::ANY_VALUE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user