Permalink
Browse files

MDL-32454 Fix issues highlighted by strict warnings in MNet code

  • Loading branch information...
1 parent 186fe7a commit 8d66adc9b804bdfc4b81efaabc09ce61db832aee @andrewnicols andrewnicols committed with stronk7 Apr 16, 2012
Showing with 14 additions and 5 deletions.
  1. +2 −2 admin/mnet/peer_forms.php
  2. +11 −2 admin/mnet/profilefields_form.php
  3. +1 −1 admin/mnet/services_form.php
@@ -50,7 +50,7 @@ function definition() {
$this->add_action_buttons(false, get_string('addhost', 'mnet'));
}
- function validation($data) {
+ function validation($data, $files) {
global $DB;
$wwwroot = $data['wwwroot'];
@@ -154,7 +154,7 @@ function definition() {
$this->add_action_buttons(false);
}
- function validation($data) {
+ function validation($data, $files) {
$errors = array();
if ($data['oldpublickey'] == $data['public_key']) {
return;
@@ -39,6 +39,15 @@ function definition() {
global $CFG;
$mform =& $this->_form;
+ $mnetprofileimportfields = '';
+ if (isset($CFG->mnetprofileimportfields)) {
+ $mnetprofileimportfields = str_replace(',', ', ', $CFG->mnetprofileimportfields);
+ }
+
+ $mnetprofileexportfields = '';
+ if (isset($CFG->mnetprofileexportfields)) {
+ $mnetprofileexportfields = str_replace(',', ', ', $CFG->mnetprofileexportfields);
+ }
$mform->addElement('hidden', 'hostid', $this->_customdata['hostid']);
$fields = mnet_profile_field_options();
@@ -49,15 +58,15 @@ function definition() {
$select = $mform->addElement('select', 'importfields', get_string('importfields', 'mnet'), $fields['optional']);
$select->setMultiple(true);
- $mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), str_replace(',', ', ', $CFG->mnetprofileimportfields));
+ $mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), $mnetprofileimportfields);
// Fields to export ----------------------------------------------------
$mform->addElement('header', 'export', get_string('exportfields', 'mnet'));
$select = $mform->addElement('select', 'exportfields', get_string('exportfields', 'mnet'), $fields['optional']);
$select->setMultiple(true);
- $mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), str_replace(',', ', ', $CFG->mnetprofileexportfields));
+ $mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), $mnetprofileexportfields);
$this->add_action_buttons();
}
@@ -36,7 +36,7 @@ class mnet_services_form extends moodleform {
function definition() {
$mform =& $this->_form;
$mnet_peer =& $this->_customdata['peer'];
- $myservices =& mnet_get_service_info($mnet_peer);
+ $myservices = mnet_get_service_info($mnet_peer);
$mform->addElement('hidden', 'hostid', $mnet_peer->id);

0 comments on commit 8d66adc

Please sign in to comment.