Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-37822 fix checkboxes that were always set to on by default

  • Loading branch information...
commit be6281e2cbc2fb40b96a48c07c80883fa80cd1b7 1 parent 1fc34e3
@mouneyrac mouneyrac authored stronk7 committed
Showing with 10 additions and 8 deletions.
  1. +10 −8 admin/registration/forms.php
View
18 admin/registration/forms.php
@@ -244,6 +244,8 @@ public function definition() {
$questionsnumber = get_config('hub', 'site_questionsnumber_' . $cleanhuburl);
$resourcesnumber = get_config('hub', 'site_resourcesnumber_' . $cleanhuburl);
$mediancoursesize = get_config('hub', 'site_mediancoursesize_' . $cleanhuburl);
+ $participantnumberaveragecfg = get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl);
+ $modulenumberaveragecfg = get_config('hub', 'site_modulenumberaverage_' . $cleanhuburl);
//hidden parameters
$mform->addElement('hidden', 'huburl', $huburl);
@@ -376,36 +378,36 @@ public function definition() {
if (HUB_MOODLEORGHUBURL != $huburl) {
$mform->addElement('checkbox', 'courses', get_string('sendfollowinginfo', 'hub'),
" " . get_string('coursesnumber', 'hub', $coursecount));
- $mform->setDefault('courses', true);
+ $mform->setDefault('courses', $coursesnumber != -1);
$mform->addHelpButton('courses', 'sendfollowinginfo', 'hub');
$mform->addElement('checkbox', 'users', '',
" " . get_string('usersnumber', 'hub', $usercount));
- $mform->setDefault('users', true);
+ $mform->setDefault('users', $usersnumber != -1);
$mform->addElement('checkbox', 'roleassignments', '',
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
- $mform->setDefault('roleassignments', true);
+ $mform->setDefault('roleassignments', $roleassignmentsnumber != -1);
$mform->addElement('checkbox', 'posts', '',
" " . get_string('postsnumber', 'hub', $postcount));
- $mform->setDefault('posts', true);
+ $mform->setDefault('posts', $postsnumber != -1);
$mform->addElement('checkbox', 'questions', '',
" " . get_string('questionsnumber', 'hub', $questioncount));
- $mform->setDefault('questions', true);
+ $mform->setDefault('questions', $questionsnumber != -1);
$mform->addElement('checkbox', 'resources', '',
" " . get_string('resourcesnumber', 'hub', $resourcecount));
- $mform->setDefault('resources', true);
+ $mform->setDefault('resources', $resourcesnumber != -1);
$mform->addElement('checkbox', 'participantnumberaverage', '',
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
- $mform->setDefault('participantnumberaverage', true);
+ $mform->setDefault('participantnumberaverage', $participantnumberaveragecfg != -1);
$mform->addElement('checkbox', 'modulenumberaverage', '',
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
- $mform->setDefault('modulenumberaverage', true);
+ $mform->setDefault('modulenumberaverage', $modulenumberaveragecfg != -1);
} else {
$mform->addElement('static', 'courseslabel', get_string('sendfollowinginfo', 'hub'),
" " . get_string('coursesnumber', 'hub', $coursecount));
Please sign in to comment.
Something went wrong with that request. Please try again.