mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-12886 minor testclient refactoring
This commit is contained in:
parent
453a7a85d4
commit
3795247688
@ -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();
|
||||
|
||||
|
@ -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;
|
@ -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'));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user