MDL-12886 minor testclient refactoring

This commit is contained in:
skodak 2009-10-16 07:55:34 +00:00
parent 453a7a85d4
commit 3795247688
3 changed files with 16 additions and 21 deletions

View File

@ -24,7 +24,7 @@
*/
require('../../../config.php');
require_once("$CFG->dirroot/webservice/webservice_test_client_form.php");
require_once("$CFG->dirroot/webservice/testclient_forms.php");
require_once("$CFG->dirroot/webservice/rest/locallib.php");
$function = optional_param('function', '', PARAM_SAFEDIR);
@ -51,7 +51,6 @@ if (!$function) {
}
$class = $function.'_form';
require_once("$CFG->dirroot/webservice/rest/testclient/$class.php");
$mform = new $class();

View File

@ -3,6 +3,21 @@
require_once($CFG->dirroot.'/lib/formslib.php');
class webservice_test_client_form extends moodleform {
public function definition() {
global $CFG;
$mform = $this->_form;
$functions = $this->_customdata;
$mform->addElement('header', 'wstestclienthdr', get_string('testclient', 'webservice'));
$mform->addElement('select', 'function', get_string('function', 'webservice'), $functions);
$this->add_action_buttons(false, get_string('select'));
}
}
class moodle_group_get_groups_form extends moodleform {
public function definition() {
global $CFG;

View File

@ -1,19 +0,0 @@
<?php
require_once($CFG->dirroot.'/lib/formslib.php');
class webservice_test_client_form extends moodleform {
public function definition() {
global $CFG;
$mform = $this->_form;
$functions = $this->_customdata;
$mform->addElement('header', 'wstestclienthdr', get_string('testclient', 'webservice'));
$mform->addElement('select', 'function', get_string('function', 'webservice'), $functions);
$this->add_action_buttons(false, get_string('select'));
}
}