MDL-70288 mod_lti: Remove unnecessary empty label string

* When a label is passed to an (advanced) checkbox and no text
  was provided, the label will be displayed on the right of the the
  checkbox element. So there's no point in passing an empty string for
  the label just to render the text to the right of the checkbox.
This commit is contained in:
Jun Pataleta 2020-12-10 22:49:39 +08:00
parent e3457dc4aa
commit 793aa03598
3 changed files with 10 additions and 10 deletions

View File

@ -60,12 +60,12 @@ class tool_capability_settings_form extends moodleform {
$form->addElement('select', 'roles', get_string('roleslabel', 'tool_capability'), $roles, $attributes);
$form->setType('roles', PARAM_TEXT);
$form->addElement('checkbox', 'onlydiff',
get_string('filters', 'tool_capability'),
get_string('onlydiff', 'tool_capability'));
$filters = [];
$filters[] = $form->createElement('checkbox', 'onlydiff', get_string('onlydiff', 'tool_capability'));
$form->setType('onlydiff', PARAM_BOOL);
$form->addGroup($filters, 'filters', get_string('filters', 'tool_capability'), array('<br>'), false);
$form->addElement('submit', 'submitbutton', get_string('getreport', 'tool_capability'));
}
}
}

View File

@ -279,7 +279,7 @@ class mod_lti_edit_types_form extends moodleform {
$mform->setDefault('lti_acceptgrades', '2');
$mform->addHelpButton('lti_acceptgrades', 'accept_grades_admin', 'lti');
$mform->addElement('checkbox', 'lti_forcessl', '&nbsp;', ' ' . get_string('force_ssl', 'lti'), $options);
$mform->addElement('checkbox', 'lti_forcessl', get_string('force_ssl', 'lti'), '', $options);
$mform->setType('lti_forcessl', PARAM_BOOL);
if (!empty($CFG->mod_lti_forcessl)) {
$mform->setDefault('lti_forcessl', '1');

View File

@ -104,12 +104,12 @@ class mod_lti_mod_form extends moodleform_mod {
$mform->setAdvanced('showdescription');
$mform->addElement('checkbox', 'showtitlelaunch', '&nbsp;', ' ' . get_string('display_name', 'lti'));
$mform->addElement('checkbox', 'showtitlelaunch', get_string('display_name', 'lti'));
$mform->setAdvanced('showtitlelaunch');
$mform->setDefault('showtitlelaunch', true);
$mform->addHelpButton('showtitlelaunch', 'display_name', 'lti');
$mform->addElement('checkbox', 'showdescriptionlaunch', '&nbsp;', ' ' . get_string('display_description', 'lti'));
$mform->addElement('checkbox', 'showdescriptionlaunch', get_string('display_description', 'lti'));
$mform->setAdvanced('showdescriptionlaunch');
$mform->addHelpButton('showdescriptionlaunch', 'display_description', 'lti');
@ -281,17 +281,17 @@ class mod_lti_mod_form extends moodleform_mod {
// Add privacy preferences fieldset where users choose whether to send their data.
$mform->addElement('header', 'privacy', get_string('privacy', 'lti'));
$mform->addElement('advcheckbox', 'instructorchoicesendname', '&nbsp;', ' ' . get_string('share_name', 'lti'));
$mform->addElement('advcheckbox', 'instructorchoicesendname', get_string('share_name', 'lti'));
$mform->setDefault('instructorchoicesendname', '1');
$mform->addHelpButton('instructorchoicesendname', 'share_name', 'lti');
$mform->disabledIf('instructorchoicesendname', 'typeid', 'in', $toolproxy);
$mform->addElement('advcheckbox', 'instructorchoicesendemailaddr', '&nbsp;', ' ' . get_string('share_email', 'lti'));
$mform->addElement('advcheckbox', 'instructorchoicesendemailaddr', get_string('share_email', 'lti'));
$mform->setDefault('instructorchoicesendemailaddr', '1');
$mform->addHelpButton('instructorchoicesendemailaddr', 'share_email', 'lti');
$mform->disabledIf('instructorchoicesendemailaddr', 'typeid', 'in', $toolproxy);
$mform->addElement('advcheckbox', 'instructorchoiceacceptgrades', '&nbsp;', ' ' . get_string('accept_grades', 'lti'));
$mform->addElement('advcheckbox', 'instructorchoiceacceptgrades', get_string('accept_grades', 'lti'));
$mform->setDefault('instructorchoiceacceptgrades', '1');
$mform->addHelpButton('instructorchoiceacceptgrades', 'accept_grades', 'lti');
$mform->disabledIf('instructorchoiceacceptgrades', 'typeid', 'in', $toolproxy);