MDL-39362 Admin: fixed setType() error for networking

This commit is contained in:
Rossiani Wijaya 2013-04-29 11:59:48 +08:00
parent cf5a3296c4
commit c71d9297a6
3 changed files with 10 additions and 0 deletions

View File

@ -78,9 +78,13 @@ class mnet_review_host_form extends moodleform {
$mnet_peer = $this->_customdata['peer'];
$mform->addElement('hidden', 'last_connect_time');
$mform->setType('last_connect_time', PARAM_INT);
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'applicationid');
$mform->setType('applicationid', PARAM_INT);
$mform->addElement('hidden', 'oldpublickey');
$mform->setType('oldpublickey', PARAM_PEM);
$mform->addElement('text', 'name', get_string('site'), array('maxlength' => 80, 'size' => 50));
$mform->setType('name', PARAM_NOTAGS);
@ -148,6 +152,7 @@ class mnet_review_host_form extends moodleform {
$mform->addGroup($radioarray, 'radioar', get_string('deleted'), array(' ', ' '), false);
} else {
$mform->addElement('hidden', 'deleted');
$mform->setType('deleted', PARAM_BOOL);
}
// finished with static stuff, print save button

View File

@ -50,6 +50,8 @@ class mnet_profile_form extends moodleform {
}
$mform->addElement('hidden', 'hostid', $this->_customdata['hostid']);
$mform->setType('hostid', PARAM_INT);
$fields = mnet_profile_field_options();
// Fields to import ----------------------------------------------------

View File

@ -39,6 +39,7 @@ class mnet_services_form extends moodleform {
$myservices = mnet_get_service_info($mnet_peer);
$mform->addElement('hidden', 'hostid', $mnet_peer->id);
$mform->setType('hostid', PARAM_INT);
$count = 0;
foreach ($myservices as $name => $versions) {
@ -55,6 +56,8 @@ class mnet_services_form extends moodleform {
$mform->addElement('html', '<h3>' . get_string($name.'_name', $langmodule , $mnet_peer->name) . '</h3>' . get_string($name.'_description', $langmodule, $mnet_peer->name));
$mform->addElement('hidden', 'exists[' . $version['serviceid'] . ']', 1);
// Temporary fix until MDL-38885 gets integrated.
$mform->setType('exists', PARAM_BOOL);
$pubstr = get_string('publish','mnet');
if (!empty($version['hostsubscribes'])) {