]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12886 minor testclient refactoring
authorskodak <skodak>
Fri, 16 Oct 2009 07:55:34 +0000 (07:55 +0000)
committerskodak <skodak>
Fri, 16 Oct 2009 07:55:34 +0000 (07:55 +0000)
webservice/rest/testclient/index.php
webservice/testclient_forms.php [moved from webservice/rest/testclient/moodle_group_get_groups_form.php with 69% similarity]
webservice/webservice_test_client_form.php [deleted file]

index 3c2fbd24d5634c4dd7c5c5a0bf1f7c0aab3f0cb9..b5361d67fac1584d08fafd323c553638b7acc921 100644 (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();
 
similarity index 69%
rename from webservice/rest/testclient/moodle_group_get_groups_form.php
rename to webservice/testclient_forms.php
index 682758ef99ef8124e60aed902d6617ad35c8e01c..e6e627a18d2b115a5fd2805a713f46306e04444f 100644 (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;
diff --git a/webservice/webservice_test_client_form.php b/webservice/webservice_test_client_form.php
deleted file mode 100644 (file)
index 5993516..0000000
+++ /dev/null
@@ -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'));
-    }
-}
\ No newline at end of file