Skip to content

Commit

Permalink
MDL-32454 Fix issues highlighted by strict warnings in MNet code
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Robert Nicols committed Apr 16, 2012
1 parent 668a499 commit 8219502
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions admin/mnet/peer_forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -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;
Expand Down
13 changes: 11 additions & 2 deletions admin/mnet/profilefields_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion admin/mnet/services_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8219502

Please sign in to comment.