|
16 | 16 |
|
17 | 17 | namespace tool_trigger\steps\actions; |
18 | 18 |
|
19 | | -defined('MOODLE_INTERNAL') || die(); |
20 | | - |
21 | | -require_once($CFG->libdir . '/externallib.php'); |
| 19 | +use core_external\external_api; |
22 | 20 |
|
23 | 21 | /** |
24 | 22 | * Webservice action step class. |
@@ -113,7 +111,7 @@ private function run_function() { |
113 | 111 | $params = $this->render_datafields($this->params); |
114 | 112 |
|
115 | 113 | // Execute the provided function name passing with the given parameters. |
116 | | - $response = \external_api::call_external_function($functionname, json_decode($params, true)); |
| 114 | + $response = external_api::call_external_function($functionname, json_decode($params, true)); |
117 | 115 | return $response; |
118 | 116 | } |
119 | 117 |
|
@@ -248,7 +246,7 @@ public function form_validation($data, $files) { |
248 | 246 | if (!empty($data['functionname'])) { |
249 | 247 | try { |
250 | 248 | $errorfield = 'functionname'; |
251 | | - $function = \external_api::external_function_info($data['functionname']); |
| 249 | + $function = external_api::external_function_info($data['functionname']); |
252 | 250 |
|
253 | 251 | $errorfield = 'params'; |
254 | 252 |
|
@@ -276,7 +274,7 @@ public function form_validation($data, $files) { |
276 | 274 | } |
277 | 275 |
|
278 | 276 | // Execute the provided function name passing with the given parameters. |
279 | | - // $response = \external_api::call_external_function($functionname, json_decode($params, true)); |
| 277 | + // $response = external_api::call_external_function($functionname, json_decode($params, true)); |
280 | 278 | // Check if the provided function parameters are valid. |
281 | 279 | call_user_func( |
282 | 280 | [$function->classname, 'validate_parameters'], |
|
0 commit comments