Skip to content

Commit

Permalink
Merge branch 'wip-MDL-59770-master' of git://github.com/marinaglancy/…
Browse files Browse the repository at this point in the history
…moodle
  • Loading branch information
danpoltawski authored and David Monllao committed Sep 7, 2017
2 parents edb9119 + 4aef64f commit 72086f7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions admin/registration/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function definition() {
$modulenumberaveragecfg = get_config('hub', 'site_modulenumberaverage_' . $cleanhuburl);
// Mobile related information.
$mobileservicesenabled = get_config('hub', 'site_mobileservicesenabled_' . $cleanhuburl);
$mobilenotificacionsenabled = get_config('hub', 'site_mobilenotificacionsenabled_' . $cleanhuburl);
$mobilenotificationsenabled = get_config('hub', 'site_mobilenotificationsenabled_' . $cleanhuburl);
$registereduserdevices = get_config('hub', 'site_registereduserdevices_' . $cleanhuburl);
$registeredactiveuserdevices = get_config('hub', 'site_registeredactiveuserdevices_' . $cleanhuburl);

Expand Down Expand Up @@ -474,10 +474,10 @@ public function definition() {
$mform->setType('mobileservicesenabled', PARAM_INT);

$mobilenotificationsstatus = $aremobilenotificationsenabled ? 'yes' : 'no';
$mform->addElement('checkbox', 'mobilenotificacionsenabled', '',
" " . get_string('mobilenotificacionsenabled', 'hub', $mobilenotificationsstatus));
$mform->setDefault('mobilenotificacionsenabled', $mobilenotificacionsenabled != -1);
$mform->setType('mobilenotificacionsenabled', PARAM_INT);
$mform->addElement('checkbox', 'mobilenotificationsenabled', '',
" " . get_string('mobilenotificationsenabled', 'hub', $mobilenotificationsstatus));
$mform->setDefault('mobilenotificationsenabled', $mobilenotificationsenabled != -1);
$mform->setType('mobilenotificationsenabled', PARAM_INT);

$mform->addElement('checkbox', 'registereduserdevices', '',
" " . get_string('registereduserdevices', 'hub', $registereduserdevicescount));
Expand Down Expand Up @@ -547,10 +547,10 @@ public function definition() {
$mform->setType('mobileservicesenabled', PARAM_INT);

$mobilenotificationsstatus = $aremobilenotificationsenabled ? 'yes' : 'no';
$mform->addElement('static', 'mobilenotificacionsenabledlabel', '',
" " . get_string('mobilenotificacionsenabled', 'hub', $mobilenotificationsstatus));
$mform->addElement('hidden', 'mobilenotificacionsenabled', 1);
$mform->setType('mobilenotificacionsenabled', PARAM_INT);
$mform->addElement('static', 'mobilenotificationsenabledlabel', '',
" " . get_string('mobilenotificationsenabled', 'hub', $mobilenotificationsstatus));
$mform->addElement('hidden', 'mobilenotificationsenabled', 1);
$mform->setType('mobilenotificationsenabled', PARAM_INT);

$mform->addElement('static', 'registereduserdeviceslabel', '',
" " . get_string('registereduserdevices', 'hub', $registereduserdevicescount));
Expand Down
4 changes: 2 additions & 2 deletions admin/registration/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public function get_site_info($huburl) {
$siteinfo['url'] = $CFG->wwwroot;
// Mobile related information.
$siteinfo['mobileservicesenabled'] = 0;
$siteinfo['mobilenotificacionsenabled'] = 0;
$siteinfo['mobilenotificationsenabled'] = 0;
$siteinfo['registereduserdevices'] = 0;
$siteinfo['registeredactiveuserdevices'] = 0;
if (!empty($CFG->enablewebservices) && !empty($CFG->enablemobilewebservice)) {
Expand All @@ -291,7 +291,7 @@ public function get_site_info($huburl) {
$airnotifierextpath = $CFG->dirroot . '/message/output/airnotifier/externallib.php';
if (file_exists($airnotifierextpath)) { // Maybe some one uninstalled the plugin.
require_once($airnotifierextpath);
$siteinfo['mobilenotificacionsenabled'] = message_airnotifier_external::is_system_configured();
$siteinfo['mobilenotificationsenabled'] = message_airnotifier_external::is_system_configured();
$siteinfo['registeredactiveuserdevices'] = $DB->count_records('message_airnotifier_devices', array('enable' => 1));
}
}
Expand Down
6 changes: 3 additions & 3 deletions admin/registration/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
// The function get_site_info() will not calculate the optional data if config is set to -1.
$inputnames = array('courses', 'users', 'roleassignments', 'posts', 'questions', 'resources',
'badges', 'issuedbadges', 'modulenumberaverage', 'participantnumberaverage',
'mobileservicesenabled', 'mobilenotificacionsenabled', 'registereduserdevices', 'registeredactiveuserdevices');
'mobileservicesenabled', 'mobilenotificationsenabled', 'registereduserdevices', 'registeredactiveuserdevices');
foreach ($inputnames as $inputname) {
if (empty($fromform->{$inputname})) {
$fromform->{$inputname} = -1;
Expand Down Expand Up @@ -103,7 +103,7 @@
set_config('site_modulenumberaverage_' . $cleanhuburl, $fromform->modulenumberaverage, 'hub');
set_config('site_participantnumberaverage_' . $cleanhuburl, $fromform->participantnumberaverage, 'hub');
set_config('site_mobileservicesenabled_' . $cleanhuburl, $fromform->mobileservicesenabled, 'hub');
set_config('site_mobilenotificacionsenabled_' . $cleanhuburl, $fromform->mobilenotificacionsenabled, 'hub');
set_config('site_mobilenotificationsenabled_' . $cleanhuburl, $fromform->mobilenotificationsenabled, 'hub');
set_config('site_registereduserdevices_' . $cleanhuburl, $fromform->registereduserdevices, 'hub');
set_config('site_registeredactiveuserdevices_' . $cleanhuburl, $fromform->registeredactiveuserdevices, 'hub');
}
Expand Down Expand Up @@ -149,7 +149,7 @@
$fromform->participantnumberaverage = $siteinfo['participantnumberaverage'];
$fromform->street = $siteinfo['street'];
$fromform->mobileservicesenabled = $siteinfo['mobileservicesenabled'];
$fromform->mobilenotificacionsenabled = $siteinfo['mobilenotificacionsenabled'];
$fromform->mobilenotificationsenabled = $siteinfo['mobilenotificationsenabled'];
$fromform->registereduserdevices = $siteinfo['registereduserdevices'];
$fromform->registeredactiveuserdevices = $siteinfo['registeredactiveuserdevices'];

Expand Down
2 changes: 1 addition & 1 deletion lang/en/hub.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
$string['licence_help'] = 'Select the licence you want to distribute your course under.';
$string['licence_link'] = 'licenses';
$string['logourl'] = 'Logo URL';
$string['mobilenotificacionsenabled'] = 'Mobile notifications enabled ({$a})';
$string['mobilenotificationsenabled'] = 'Mobile notifications enabled ({$a})';
$string['mobileservicesenabled'] = 'Mobile services enabled ({$a})';
$string['modulenumberaverage'] = 'Average number of course modules ({$a})';
$string['moodleorg'] = 'Moodle';
Expand Down

0 comments on commit 72086f7

Please sign in to comment.