]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12886 support for custom test client forms in plugins
authorPetr Skoda <skodak@moodle.org>
Tue, 27 Oct 2009 09:32:36 +0000 (09:32 +0000)
committerPetr Skoda <skodak@moodle.org>
Tue, 27 Oct 2009 09:32:36 +0000 (09:32 +0000)
webservice/testclient.php

index f4f0cb3e6d9415d25753012a6d3d45a2943127b0..ee5269b6515c9bd2e4fa183a59a1b0df01a6a3a6 100644 (file)
@@ -40,6 +40,11 @@ require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
 $allfunctions = $DB->get_records('external_functions', array(), 'name ASC');
 $functions = array();
 foreach ($allfunctions as $f) {
+    $finfo = external_function_info($f);
+    if (!empty($finfo->testclientpath) and file_exists($CFG->dirroot.'/'.$finfo->testclientpath)) {
+        //some plugins may want to have own test client forms
+        include_once($CFG->dirroot.'/'.$finfo->testclientpath);
+    }
     $class = $f->name.'_form';
     if (class_exists($class)) {
         $functions[$f->name] = $f->name;