Skip to content

Commit

Permalink
MDL-70288 mod_lti: Remove unnecessary empty label string
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
junpataleta committed Feb 2, 2021
1 parent e3457dc commit 793aa03
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions admin/tool/capability/classes/settings_form.php
Expand Up @@ -60,12 +60,12 @@ public function definition() {
$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'));
}

}
}
2 changes: 1 addition & 1 deletion mod/lti/edit_form.php
Expand Up @@ -279,7 +279,7 @@ public function definition() {
$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');
Expand Down
10 changes: 5 additions & 5 deletions mod/lti/mod_form.php
Expand Up @@ -104,12 +104,12 @@ public function definition() {

$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');

Expand Down Expand Up @@ -281,17 +281,17 @@ public function definition() {
// 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);
Expand Down

0 comments on commit 793aa03

Please sign in to comment.