MDL-53240 filetypes: Add functions to be used for input validation
[moodle.git] / lib / db / services.php
CommitLineData
9a0df45a 1<?php
9a0df45a 2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
a0a07014 17
9a0df45a 18/**
19 * Core external functions and service definitions.
20 *
39b90b51
EL
21 * The functions and services defined on this file are
22 * processed and registered into the Moodle DB after any
23 * install or upgrade operation. All plugins support this.
24 *
25 * For more information, take a look to the documentation available:
26 * - Webservices API: {@link http://docs.moodle.org/dev/Web_services_API}
27 * - External API: {@link http://docs.moodle.org/dev/External_functions_API}
28 * - Upgrade API: {@link http://docs.moodle.org/dev/Upgrade_API}
29 *
a0a07014
JM
30 * @package core_webservice
31 * @category webservice
32 * @copyright 2009 Petr Skodak
9a0df45a 33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 */
35
36$functions = array(
83e4dc17
JL
37 'core_auth_confirm_user' => array(
38 'classname' => 'core_auth_external',
39 'methodname' => 'confirm_user',
40 'description' => 'Confirm a user account.',
41 'type' => 'write',
42 'ajax' => true,
43 'loginrequired' => false,
44 ),
f23e9b6b
CB
45 'core_badges_get_user_badges' => array(
46 'classname' => 'core_badges_external',
47 'methodname' => 'get_user_badges',
48 'description' => 'Returns the list of badges awarded to a user.',
49 'type' => 'read',
ee7295ee
JL
50 'capabilities' => 'moodle/badges:viewotherbadges',
51 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
088645e2 52 ),
f23e9b6b
CB
53 'core_calendar_create_calendar_events' => array(
54 'classname' => 'core_calendar_external',
55 'methodname' => 'create_calendar_events',
56 'description' => 'Create calendar events',
57 'classpath' => 'calendar/externallib.php',
58 'type' => 'write',
e453ed68
JL
59 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
60 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
088645e2 61 ),
f23e9b6b
CB
62 'core_calendar_delete_calendar_events' => array(
63 'classname' => 'core_calendar_external',
64 'methodname' => 'delete_calendar_events',
65 'description' => 'Delete calendar events',
66 'classpath' => 'calendar/externallib.php',
67 'type' => 'write',
e453ed68
JL
68 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
69 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
088645e2 70 ),
f23e9b6b
CB
71 'core_calendar_get_calendar_events' => array(
72 'classname' => 'core_calendar_external',
73 'methodname' => 'get_calendar_events',
74 'description' => 'Get calendar events',
75 'classpath' => 'calendar/externallib.php',
76 'type' => 'read',
ee7295ee
JL
77 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
78 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
088645e2 79 ),
c0f877fa
MN
80 'core_calendar_get_action_events_by_timesort' => array(
81 'classname' => 'core_calendar_external',
82 'methodname' => 'get_calendar_action_events_by_timesort',
83 'description' => 'Get calendar action events by tiemsort',
84 'classpath' => 'calendar/externallib.php',
85 'type' => 'read',
86 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
60774b28 87 'ajax' => true,
569d091b 88 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
60774b28
RW
89 ),
90 'core_calendar_get_action_events_by_course' => array(
91 'classname' => 'core_calendar_external',
92 'methodname' => 'get_calendar_action_events_by_course',
93 'description' => 'Get calendar action events by course',
94 'classpath' => 'calendar/externallib.php',
95 'type' => 'read',
96 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
9b8e5057 97 'ajax' => true,
569d091b 98 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9b8e5057
RW
99 ),
100 'core_calendar_get_action_events_by_courses' => array(
101 'classname' => 'core_calendar_external',
102 'methodname' => 'get_calendar_action_events_by_courses',
103 'description' => 'Get calendar action events by courses',
104 'classpath' => 'calendar/externallib.php',
105 'type' => 'read',
106 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
c0f877fa 107 'ajax' => true,
569d091b 108 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
c0f877fa 109 ),
088645e2 110 'core_cohort_add_cohort_members' => array(
f23e9b6b
CB
111 'classname' => 'core_cohort_external',
112 'methodname' => 'add_cohort_members',
113 'classpath' => 'cohort/externallib.php',
088645e2 114 'description' => 'Adds cohort members.',
f23e9b6b
CB
115 'type' => 'write',
116 'capabilities' => 'moodle/cohort:assign'
117 ),
118 'core_cohort_create_cohorts' => array(
119 'classname' => 'core_cohort_external',
120 'methodname' => 'create_cohorts',
121 'classpath' => 'cohort/externallib.php',
122 'description' => 'Creates new cohorts.',
123 'type' => 'write',
124 'capabilities' => 'moodle/cohort:manage'
088645e2 125 ),
088645e2 126 'core_cohort_delete_cohort_members' => array(
f23e9b6b
CB
127 'classname' => 'core_cohort_external',
128 'methodname' => 'delete_cohort_members',
129 'classpath' => 'cohort/externallib.php',
088645e2 130 'description' => 'Deletes cohort members.',
0a4f3eb2 131 'type' => 'write',
f23e9b6b
CB
132 'capabilities' => 'moodle/cohort:assign'
133 ),
134 'core_cohort_delete_cohorts' => array(
135 'classname' => 'core_cohort_external',
136 'methodname' => 'delete_cohorts',
137 'classpath' => 'cohort/externallib.php',
138 'description' => 'Deletes all specified cohorts.',
0a4f3eb2 139 'type' => 'write',
f23e9b6b 140 'capabilities' => 'moodle/cohort:manage'
088645e2 141 ),
088645e2 142 'core_cohort_get_cohort_members' => array(
f23e9b6b
CB
143 'classname' => 'core_cohort_external',
144 'methodname' => 'get_cohort_members',
145 'classpath' => 'cohort/externallib.php',
088645e2 146 'description' => 'Returns cohort members.',
f23e9b6b
CB
147 'type' => 'read',
148 'capabilities' => 'moodle/cohort:view'
e77a0f36 149 ),
f23e9b6b
CB
150 'core_cohort_get_cohorts' => array(
151 'classname' => 'core_cohort_external',
152 'methodname' => 'get_cohorts',
153 'classpath' => 'cohort/externallib.php',
154 'description' => 'Returns cohort details.',
155 'type' => 'read',
156 'capabilities' => 'moodle/cohort:view'
d3549931 157 ),
f23e9b6b
CB
158 'core_cohort_update_cohorts' => array(
159 'classname' => 'core_cohort_external',
160 'methodname' => 'update_cohorts',
161 'classpath' => 'cohort/externallib.php',
162 'description' => 'Updates existing cohorts.',
163 'type' => 'write',
164 'capabilities' => 'moodle/cohort:manage'
d3549931 165 ),
f23e9b6b
CB
166 'core_comment_get_comments' => array(
167 'classname' => 'core_comment_external',
168 'methodname' => 'get_comments',
169 'description' => 'Returns comments.',
170 'type' => 'read',
ee7295ee
JL
171 'capabilities' => 'moodle/comment:view',
172 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 173 ),
f23e9b6b
CB
174 'core_completion_get_activities_completion_status' => array(
175 'classname' => 'core_completion_external',
176 'methodname' => 'get_activities_completion_status',
177 'description' => 'Return the activities completion status for a user in a course.',
178 'type' => 'read',
ee7295ee 179 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 180 ),
f23e9b6b
CB
181 'core_completion_get_course_completion_status' => array(
182 'classname' => 'core_completion_external',
183 'methodname' => 'get_course_completion_status',
184 'description' => 'Returns course completion status.',
185 'type' => 'read',
ee7295ee
JL
186 'capabilities' => 'report/completion:view',
187 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 188 ),
f23e9b6b
CB
189 'core_completion_mark_course_self_completed' => array(
190 'classname' => 'core_completion_external',
191 'methodname' => 'mark_course_self_completed',
192 'description' => 'Update the course completion status for the current user (if course self-completion is enabled).',
193 'type' => 'write',
ee7295ee 194 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 195 ),
f23e9b6b
CB
196 'core_completion_update_activity_completion_status_manually' => array(
197 'classname' => 'core_completion_external',
198 'methodname' => 'update_activity_completion_status_manually',
199 'description' => 'Update completion status for the current user in an activity, only for activities with manual tracking.',
200 'type' => 'write',
ee7295ee 201 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 202 ),
f23e9b6b
CB
203 'core_course_create_categories' => array(
204 'classname' => 'core_course_external',
205 'methodname' => 'create_categories',
206 'classpath' => 'course/externallib.php',
207 'description' => 'Create course categories',
208 'type' => 'write',
209 'capabilities' => 'moodle/category:manage'
246f6da2 210 ),
f23e9b6b
CB
211 'core_course_create_courses' => array(
212 'classname' => 'core_course_external',
213 'methodname' => 'create_courses',
214 'classpath' => 'course/externallib.php',
215 'description' => 'Create new courses',
216 'type' => 'write',
217 'capabilities' => 'moodle/course:create, moodle/course:visibility'
5d1017e1 218 ),
f23e9b6b
CB
219 'core_course_delete_categories' => array(
220 'classname' => 'core_course_external',
221 'methodname' => 'delete_categories',
222 'classpath' => 'course/externallib.php',
223 'description' => 'Delete course categories',
224 'type' => 'write',
225 'capabilities' => 'moodle/category:manage'
9a0df45a 226 ),
f23e9b6b
CB
227 'core_course_delete_courses' => array(
228 'classname' => 'core_course_external',
229 'methodname' => 'delete_courses',
230 'classpath' => 'course/externallib.php',
231 'description' => 'Deletes all specified courses',
232 'type' => 'write',
233 'capabilities' => 'moodle/course:delete'
5d1017e1 234 ),
f23e9b6b
CB
235 'core_course_delete_modules' => array(
236 'classname' => 'core_course_external',
237 'methodname' => 'delete_modules',
238 'classpath' => 'course/externallib.php',
239 'description' => 'Deletes all specified module instances',
240 'type' => 'write',
241 'capabilities' => 'moodle/course:manageactivities'
9a0df45a 242 ),
f23e9b6b
CB
243 'core_course_duplicate_course' => array(
244 'classname' => 'core_course_external',
245 'methodname' => 'duplicate_course',
246 'classpath' => 'course/externallib.php',
247 'description' => 'Duplicate an existing course (creating a new one), without user data',
248 'type' => 'write',
249 'capabilities' => 'moodle/backup:backupcourse, moodle/restore:restorecourse, moodle/course:create'
5d1017e1 250 ),
f23e9b6b
CB
251 'core_course_get_categories' => array(
252 'classname' => 'core_course_external',
253 'methodname' => 'get_categories',
254 'classpath' => 'course/externallib.php',
255 'description' => 'Return category details',
256 'type' => 'read',
331e038b
JL
257 'capabilities' => 'moodle/category:viewhiddencategories',
258 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 259 ),
f23e9b6b
CB
260 'core_course_get_contents' => array(
261 'classname' => 'core_course_external',
262 'methodname' => 'get_course_contents',
263 'classpath' => 'course/externallib.php',
264 'description' => 'Get course contents',
265 'type' => 'read',
ee7295ee
JL
266 'capabilities' => 'moodle/course:update, moodle/course:viewhiddencourses',
267 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 268 ),
f23e9b6b
CB
269 'core_course_get_course_module' => array(
270 'classname' => 'core_course_external',
271 'methodname' => 'get_course_module',
272 'classpath' => 'course/externallib.php',
273 'description' => 'Return information about a course module',
274 'type' => 'read',
ee7295ee 275 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 276 ),
f23e9b6b
CB
277 'core_course_get_course_module_by_instance' => array(
278 'classname' => 'core_course_external',
279 'methodname' => 'get_course_module_by_instance',
280 'classpath' => 'course/externallib.php',
281 'description' => 'Return information about a given module name and instance id',
282 'type' => 'read',
ee7295ee 283 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 284 ),
4529327a
MG
285 'core_course_get_module' => array(
286 'classname' => 'core_course_external',
287 'methodname' => 'get_module',
288 'classpath' => 'course/externallib.php',
289 'description' => 'Returns html with one activity module on course page',
290 'type' => 'read',
291 'ajax' => true,
292 ),
293 'core_course_edit_module' => array(
294 'classname' => 'core_course_external',
295 'methodname' => 'edit_module',
296 'classpath' => 'course/externallib.php',
297 'description' => 'Performs an action on course module (change visibility, duplicate, delete, etc.)',
298 'type' => 'write',
299 'ajax' => true,
300 ),
301 'core_course_edit_section' => array(
302 'classname' => 'core_course_external',
303 'methodname' => 'edit_section',
304 'classpath' => 'course/externallib.php',
305 'description' => 'Performs an action on course section (change visibility, set marker, delete)',
306 'type' => 'write',
307 'ajax' => true,
308 ),
f23e9b6b
CB
309 'core_course_get_courses' => array(
310 'classname' => 'core_course_external',
311 'methodname' => 'get_courses',
312 'classpath' => 'course/externallib.php',
313 'description' => 'Return course details',
314 'type' => 'read',
315 'capabilities' => 'moodle/course:view, moodle/course:update, moodle/course:viewhiddencourses',
5041600d 316 'ajax' => true,
ee7295ee 317 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 318 ),
f23e9b6b
CB
319 'core_course_import_course' => array(
320 'classname' => 'core_course_external',
321 'methodname' => 'import_course',
322 'classpath' => 'course/externallib.php',
323 'description' => 'Import course data from a course into another course. Does not include any user data.',
324 'type' => 'write',
325 'capabilities' => 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport'
7ce23590 326 ),
f23e9b6b
CB
327 'core_course_search_courses' => array(
328 'classname' => 'core_course_external',
329 'methodname' => 'search_courses',
330 'classpath' => 'course/externallib.php',
331 'description' => 'Search courses by (name, module, block, tag)',
332 'type' => 'read',
5041600d 333 'ajax' => true,
ee7295ee 334 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 335 ),
f23e9b6b
CB
336 'core_course_update_categories' => array(
337 'classname' => 'core_course_external',
338 'methodname' => 'update_categories',
339 'classpath' => 'course/externallib.php',
340 'description' => 'Update categories',
341 'type' => 'write',
342 'capabilities' => 'moodle/category:manage',
7ce23590 343 ),
f23e9b6b
CB
344 'core_course_update_courses' => array(
345 'classname' => 'core_course_external',
346 'methodname' => 'update_courses',
347 'classpath' => 'course/externallib.php',
348 'description' => 'Update courses',
349 'type' => 'write',
350 'capabilities' => 'moodle/course:update, moodle/course:changecategory, moodle/course:changefullname, '
351 . 'moodle/course:changeshortname, moodle/course:changeidnumber, moodle/course:changesummary, moodle/course:visibility'
7ce23590 352 ),
f23e9b6b
CB
353 'core_course_view_course' => array(
354 'classname' => 'core_course_external',
355 'methodname' => 'view_course',
356 'classpath' => 'course/externallib.php',
357 'description' => 'Log that the course was viewed',
358 'type' => 'write',
ee7295ee 359 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 360 ),
7c4e686f
JL
361 'core_course_get_activities_overview' => array(
362 'classname' => 'core_course_external',
363 'methodname' => 'get_activities_overview',
364 'classpath' => 'course/externallib.php',
e9dfeec9
MN
365 'description' => '** DEPRECATED ** Please do not call this function any more.
366 Return activities overview for the given courses.',
7c4e686f
JL
367 'type' => 'read',
368 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
369 ),
c115ff6a
JL
370 'core_course_get_user_navigation_options' => array(
371 'classname' => 'core_course_external',
372 'methodname' => 'get_user_navigation_options',
373 'classpath' => 'course/externallib.php',
374 'description' => 'Return a list of navigation options in a set of courses that are avaialable or not for the current user.',
375 'type' => 'read',
376 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
377 ),
b9050b10
JL
378 'core_course_get_user_administration_options' => array(
379 'classname' => 'core_course_external',
380 'methodname' => 'get_user_administration_options',
381 'classpath' => 'course/externallib.php',
382 'description' => 'Return a list of administration options in a set of courses that are avaialable or not for the current
383 user.',
384 'type' => 'read',
385 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
386 ),
80adabef
JL
387 'core_course_get_courses_by_field' => array(
388 'classname' => 'core_course_external',
389 'methodname' => 'get_courses_by_field',
390 'classpath' => 'course/externallib.php',
391 'description' => 'Get courses matching a specific field (id/s, shortname, idnumber, category)',
392 'type' => 'read',
393 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
394 ),
26659f62
JL
395 'core_course_check_updates' => array(
396 'classname' => 'core_course_external',
397 'methodname' => 'check_updates',
398 'classpath' => 'course/externallib.php',
399 'description' => 'Check if there is updates affecting the user for the given course and contexts.',
400 'type' => 'read',
401 'ajax' => true,
402 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
403 ),
879a8f56
JL
404 'core_course_get_updates_since' => array(
405 'classname' => 'core_course_external',
406 'methodname' => 'get_updates_since',
407 'classpath' => 'course/externallib.php',
408 'description' => 'Check if there are updates affecting the user for the given course since the given time stamp.',
409 'type' => 'read',
410 'ajax' => true,
411 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
412 ),
f23e9b6b
CB
413 'core_enrol_get_course_enrolment_methods' => array(
414 'classname' => 'core_enrol_external',
415 'methodname' => 'get_course_enrolment_methods',
416 'classpath' => 'enrol/externallib.php',
417 'description' => 'Get the list of course enrolment methods',
418 'type' => 'read',
ee7295ee 419 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d62e813 420 ),
f23e9b6b
CB
421 'core_enrol_get_enrolled_users' => array(
422 'classname' => 'core_enrol_external',
423 'methodname' => 'get_enrolled_users',
424 'classpath' => 'enrol/externallib.php',
425 'description' => 'Get enrolled users by course id.',
426 'type' => 'read',
427 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
ee7295ee
JL
428 . 'moodle/site:accessallgroups',
429 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7107c2f0 430 ),
f23e9b6b
CB
431 'core_enrol_get_enrolled_users_with_capability' => array(
432 'classname' => 'core_enrol_external',
433 'methodname' => 'get_enrolled_users_with_capability',
434 'classpath' => 'enrol/externallib.php',
435 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
436 and have that capability',
437 'type' => 'read',
c0ef63eb 438 ),
f23e9b6b
CB
439 'core_enrol_get_users_courses' => array(
440 'classname' => 'core_enrol_external',
441 'methodname' => 'get_users_courses',
442 'classpath' => 'enrol/externallib.php',
443 'description' => 'Get the list of courses where a user is enrolled in',
444 'type' => 'read',
ee7295ee
JL
445 'capabilities' => 'moodle/course:viewparticipants',
446 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9857381d 447 ),
f23e9b6b
CB
448 'core_fetch_notifications' => array(
449 'classname' => 'core_external',
450 'methodname' => 'fetch_notifications',
451 'classpath' => 'lib/external/externallib.php',
452 'description' => 'Return a list of notifications for the current session',
453 'type' => 'read',
5041600d
RT
454 'loginrequired' => false,
455 'ajax' => true,
5d1017e1 456 ),
5d1017e1 457 'core_files_get_files' => array(
f23e9b6b
CB
458 'classname' => 'core_files_external',
459 'methodname' => 'get_files',
249c4f60 460 'description' => 'browse moodle files',
f23e9b6b
CB
461 'type' => 'read',
462 'classpath' => 'files/externallib.php',
ee7295ee 463 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 464 ),
5d1017e1 465 'core_files_upload' => array(
f23e9b6b
CB
466 'classname' => 'core_files_external',
467 'methodname' => 'upload',
249c4f60
DC
468 'description' => 'upload a file to moodle',
469 'type' => 'write',
470 'classpath' => 'files/externallib.php',
471 ),
f23e9b6b
CB
472 'core_get_component_strings' => array(
473 'classname' => 'core_external',
474 'methodname' => 'get_component_strings',
475 'classpath' => 'lib/external/externallib.php',
faeca20d
DM
476 'description' => 'Return all raw strings (with {$a->xxx}), for a specific component ' .
477 '- similar to core get_component_strings(), call',
f23e9b6b 478 'type' => 'read',
5041600d
RT
479 'loginrequired' => false,
480 'ajax' => true,
ee7295ee 481 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3364dbb5 482 ),
f23e9b6b
CB
483 'core_get_fragment' => array(
484 'classname' => 'core_external',
485 'methodname' => 'get_fragment',
486 'classpath' => 'lib/external/externallib.php',
487 'description' => 'Return a fragment for inclusion, such as a JavaScript page.',
488 'type' => 'read',
5041600d 489 'ajax' => true,
5d1017e1 490 ),
f23e9b6b
CB
491 'core_get_string' => array(
492 'classname' => 'core_external',
493 'methodname' => 'get_string',
494 'classpath' => 'lib/external/externallib.php',
495 'description' => 'Return a translated string - similar to core get_string(), call',
496 'type' => 'read',
5041600d
RT
497 'loginrequired' => false,
498 'ajax' => true,
be9bf94e 499 ),
f23e9b6b
CB
500 'core_get_strings' => array(
501 'classname' => 'core_external',
502 'methodname' => 'get_strings',
503 'classpath' => 'lib/external/externallib.php',
504 'description' => 'Return some translated strings - like several core get_string(), calls',
505 'type' => 'read',
5041600d
RT
506 'loginrequired' => false,
507 'ajax' => true,
5d1017e1 508 ),
88c2941b
RW
509 'core_get_user_dates' => array(
510 'classname' => 'core_external',
511 'methodname' => 'get_user_dates',
512 'classpath' => 'lib/external/externallib.php',
513 'description' => 'Return formatted timestamps',
514 'type' => 'read',
515 'ajax' => true,
516 ),
f23e9b6b
CB
517 'core_grades_get_grades' => array(
518 'classname' => 'core_grades_external',
519 'methodname' => 'get_grades',
aa7e371a
JL
520 'description' => '** DEPRECATED ** Please do not call this function any more.
521 Returns student course total grade and grades for activities.
f23e9b6b
CB
522 This function does not return category or manual items.
523 This function is suitable for managers or teachers not students.',
524 'type' => 'read',
525 'capabilities' => 'moodle/grade:view, moodle/grade:viewall, moodle/grade:viewhidden'
e9b66095 526 ),
f23e9b6b
CB
527 'core_grades_update_grades' => array(
528 'classname' => 'core_grades_external',
529 'methodname' => 'update_grades',
530 'description' => 'Update a grade item and associated student grades.',
531 'type' => 'write',
5d1017e1 532 ),
f23e9b6b
CB
533 'core_grading_get_definitions' => array(
534 'classname' => 'core_grading_external',
535 'methodname' => 'get_definitions',
536 'description' => 'Get grading definitions',
537 'type' => 'read',
e9b66095 538 ),
f23e9b6b
CB
539 'core_grading_get_gradingform_instances' => array(
540 'classname' => 'core_grading_external',
541 'methodname' => 'get_gradingform_instances',
542 'description' => 'Get grading form instances',
543 'type' => 'read',
f2229c68 544 ),
f23e9b6b
CB
545 'core_grading_save_definitions' => array(
546 'classname' => 'core_grading_external',
547 'methodname' => 'save_definitions',
548 'description' => 'Save grading definitions',
549 'type' => 'write',
5d1017e1 550 ),
f23e9b6b
CB
551 'core_group_add_group_members' => array(
552 'classname' => 'core_group_external',
553 'methodname' => 'add_group_members',
554 'classpath' => 'group/externallib.php',
555 'description' => 'Adds group members.',
556 'type' => 'write',
557 'capabilities' => 'moodle/course:managegroups',
6bb31e40 558 ),
f23e9b6b
CB
559 'core_group_assign_grouping' => array(
560 'classname' => 'core_group_external',
561 'methodname' => 'assign_grouping',
562 'classpath' => 'group/externallib.php',
563 'description' => 'Assing groups from groupings',
564 'type' => 'write',
740c354f 565 ),
f23e9b6b
CB
566 'core_group_create_groupings' => array(
567 'classname' => 'core_group_external',
568 'methodname' => 'create_groupings',
569 'classpath' => 'group/externallib.php',
570 'description' => 'Creates new groupings',
571 'type' => 'write',
5d1017e1 572 ),
f23e9b6b
CB
573 'core_group_create_groups' => array(
574 'classname' => 'core_group_external',
575 'methodname' => 'create_groups',
576 'classpath' => 'group/externallib.php',
577 'description' => 'Creates new groups.',
578 'type' => 'write',
579 'capabilities' => 'moodle/course:managegroups'
6bb31e40 580 ),
f23e9b6b
CB
581 'core_group_delete_group_members' => array(
582 'classname' => 'core_group_external',
583 'methodname' => 'delete_group_members',
584 'classpath' => 'group/externallib.php',
585 'description' => 'Deletes group members.',
0a4f3eb2 586 'type' => 'write',
f23e9b6b 587 'capabilities' => 'moodle/course:managegroups'
63a85dc7 588 ),
f23e9b6b
CB
589 'core_group_delete_groupings' => array(
590 'classname' => 'core_group_external',
591 'methodname' => 'delete_groupings',
592 'classpath' => 'group/externallib.php',
593 'description' => 'Deletes all specified groupings.',
79949c1b 594 'type' => 'write',
79949c1b 595 ),
f23e9b6b
CB
596 'core_group_delete_groups' => array(
597 'classname' => 'core_group_external',
598 'methodname' => 'delete_groups',
599 'classpath' => 'group/externallib.php',
600 'description' => 'Deletes all specified groups.',
0a4f3eb2 601 'type' => 'write',
f23e9b6b 602 'capabilities' => 'moodle/course:managegroups'
3dc1d76e 603 ),
f23e9b6b
CB
604 'core_group_get_activity_allowed_groups' => array(
605 'classname' => 'core_group_external',
606 'methodname' => 'get_activity_allowed_groups',
607 'classpath' => 'group/externallib.php',
608 'description' => 'Gets a list of groups that the user is allowed to access within the specified activity.',
609 'type' => 'read',
ee7295ee 610 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
791723c3 611 ),
f23e9b6b
CB
612 'core_group_get_activity_groupmode' => array(
613 'classname' => 'core_group_external',
614 'methodname' => 'get_activity_groupmode',
615 'classpath' => 'group/externallib.php',
616 'description' => 'Returns effective groupmode used in a given activity.',
617 'type' => 'read',
ee7295ee 618 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
c4f7bf29 619 ),
f23e9b6b
CB
620 'core_group_get_course_groupings' => array(
621 'classname' => 'core_group_external',
622 'methodname' => 'get_course_groupings',
623 'classpath' => 'group/externallib.php',
624 'description' => 'Returns all groupings in specified course.',
625 'type' => 'read',
c5158499 626 ),
f23e9b6b
CB
627 'core_group_get_course_groups' => array(
628 'classname' => 'core_group_external',
629 'methodname' => 'get_course_groups',
630 'classpath' => 'group/externallib.php',
631 'description' => 'Returns all groups in specified course.',
632 'type' => 'read',
633 'capabilities' => 'moodle/course:managegroups'
13bb6819 634 ),
f23e9b6b
CB
635 'core_group_get_course_user_groups' => array(
636 'classname' => 'core_group_external',
637 'methodname' => 'get_course_user_groups',
638 'classpath' => 'group/externallib.php',
639 'description' => 'Returns all groups in specified course for the specified user.',
640 'type' => 'read',
ee7295ee
JL
641 'capabilities' => 'moodle/course:managegroups',
642 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3ec163dd 643 ),
f23e9b6b
CB
644 'core_group_get_group_members' => array(
645 'classname' => 'core_group_external',
646 'methodname' => 'get_group_members',
647 'classpath' => 'group/externallib.php',
648 'description' => 'Returns group members.',
649 'type' => 'read',
650 'capabilities' => 'moodle/course:managegroups'
479a5db1 651 ),
f23e9b6b
CB
652 'core_group_get_groupings' => array(
653 'classname' => 'core_group_external',
654 'methodname' => 'get_groupings',
655 'classpath' => 'group/externallib.php',
656 'description' => 'Returns groupings details.',
657 'type' => 'read',
3ec163dd 658 ),
f23e9b6b
CB
659 'core_group_get_groups' => array(
660 'classname' => 'core_group_external',
661 'methodname' => 'get_groups',
662 'classpath' => 'group/externallib.php',
663 'description' => 'Returns group details.',
664 'type' => 'read',
665 'capabilities' => 'moodle/course:managegroups'
2f951d86 666 ),
f23e9b6b
CB
667 'core_group_unassign_grouping' => array(
668 'classname' => 'core_group_external',
669 'methodname' => 'unassign_grouping',
670 'classpath' => 'group/externallib.php',
671 'description' => 'Unassing groups from groupings',
672 'type' => 'write',
8430d87b 673 ),
f23e9b6b
CB
674 'core_group_update_groupings' => array(
675 'classname' => 'core_group_external',
676 'methodname' => 'update_groupings',
677 'classpath' => 'group/externallib.php',
678 'description' => 'Updates existing groupings',
679 'type' => 'write',
5d1017e1 680 ),
f23e9b6b
CB
681 'core_message_block_contacts' => array(
682 'classname' => 'core_message_external',
683 'methodname' => 'block_contacts',
684 'classpath' => 'message/externallib.php',
685 'description' => 'Block contacts',
686 'type' => 'write',
c6e97f54 687 'ajax' => true,
ee7295ee 688 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
a623b6b8 689 ),
d6731600 690 'core_message_create_contacts' => array(
f23e9b6b
CB
691 'classname' => 'core_message_external',
692 'methodname' => 'create_contacts',
693 'classpath' => 'message/externallib.php',
d6731600 694 'description' => 'Add contacts to the contact list',
f23e9b6b 695 'type' => 'write',
c6e97f54 696 'ajax' => true,
ee7295ee 697 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
12d8c7b2 698 'ajax' => true,
d6731600 699 ),
d6731600 700 'core_message_delete_contacts' => array(
f23e9b6b
CB
701 'classname' => 'core_message_external',
702 'methodname' => 'delete_contacts',
703 'classpath' => 'message/externallib.php',
d6731600 704 'description' => 'Remove contacts from the contact list',
f23e9b6b 705 'type' => 'write',
c6e97f54 706 'ajax' => true,
ee7295ee 707 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
12d8c7b2 708 'ajax' => true,
d6731600 709 ),
dec0cd99
MN
710 'core_message_delete_conversation' => array(
711 'classname' => 'core_message_external',
712 'methodname' => 'delete_conversation',
713 'classpath' => 'message/externallib.php',
714 'description' => 'Deletes a conversation.',
715 'type' => 'write',
716 'capabilities' => 'moodle/site:deleteownmessage',
717 'ajax' => true,
53522c6e 718 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
dec0cd99 719 ),
f23e9b6b
CB
720 'core_message_delete_message' => array(
721 'classname' => 'core_message_external',
722 'methodname' => 'delete_message',
723 'classpath' => 'message/externallib.php',
724 'description' => 'Deletes a message.',
725 'type' => 'write',
ee7295ee 726 'capabilities' => 'moodle/site:deleteownmessage',
3090f52f 727 'ajax' => true,
ee7295ee 728 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
d6731600 729 ),
f23e9b6b
CB
730 'core_message_get_blocked_users' => array(
731 'classname' => 'core_message_external',
732 'methodname' => 'get_blocked_users',
733 'classpath' => 'message/externallib.php',
734 'description' => 'Retrieve a list of users blocked',
735 'type' => 'read',
ee7295ee 736 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
d6731600 737 ),
cd03b8d7
MN
738 'core_message_data_for_messagearea_search_messages' => array(
739 'classname' => 'core_message_external',
740 'methodname' => 'data_for_messagearea_search_messages',
741 'classpath' => 'message/externallib.php',
742 'description' => 'Retrieve the template data for searching for messages',
743 'type' => 'read',
744 'ajax' => true,
53522c6e 745 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
cd03b8d7 746 ),
48e8bdba 747 'core_message_data_for_messagearea_search_users' => array(
cd03b8d7 748 'classname' => 'core_message_external',
48e8bdba 749 'methodname' => 'data_for_messagearea_search_users',
cd03b8d7
MN
750 'classpath' => 'message/externallib.php',
751 'description' => 'Retrieve the template data for searching for people',
752 'type' => 'read',
753 'ajax' => true,
754 ),
48e8bdba 755 'core_message_data_for_messagearea_search_users_in_course' => array(
cd03b8d7 756 'classname' => 'core_message_external',
48e8bdba 757 'methodname' => 'data_for_messagearea_search_users_in_course',
cd03b8d7
MN
758 'classpath' => 'message/externallib.php',
759 'description' => 'Retrieve the template data for searching for people in a course',
760 'type' => 'read',
761 'ajax' => true,
762 ),
9aa012b5
MN
763 'core_message_data_for_messagearea_conversations' => array(
764 'classname' => 'core_message_external',
765 'methodname' => 'data_for_messagearea_conversations',
766 'classpath' => 'message/externallib.php',
767 'description' => 'Retrieve the template data for the conversation list',
768 'type' => 'read',
769 'ajax' => true,
21d9f020 770 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9aa012b5
MN
771 ),
772 'core_message_data_for_messagearea_contacts' => array(
773 'classname' => 'core_message_external',
774 'methodname' => 'data_for_messagearea_contacts',
775 'classpath' => 'message/externallib.php',
776 'description' => 'Retrieve the template data for the contact list',
777 'type' => 'read',
778 'ajax' => true,
21d9f020 779 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9aa012b5 780 ),
3cd13828
MN
781 'core_message_data_for_messagearea_messages' => array(
782 'classname' => 'core_message_external',
783 'methodname' => 'data_for_messagearea_messages',
784 'classpath' => 'message/externallib.php',
785 'description' => 'Retrieve the template data for the messages',
786 'type' => 'read',
787 'ajax' => true,
21d9f020 788 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3cd13828 789 ),
c060cd49
MN
790 'core_message_data_for_messagearea_get_most_recent_message' => array(
791 'classname' => 'core_message_external',
792 'methodname' => 'data_for_messagearea_get_most_recent_message',
793 'classpath' => 'message/externallib.php',
794 'description' => 'Retrieve the template data for the most recent message',
795 'type' => 'read',
796 'ajax' => true,
797 ),
c6e97f54
MN
798 'core_message_data_for_messagearea_get_profile' => array(
799 'classname' => 'core_message_external',
800 'methodname' => 'data_for_messagearea_get_profile',
801 'classpath' => 'message/externallib.php',
802 'description' => 'Retrieve the template data for the users\'s profile',
803 'type' => 'read',
804 'ajax' => true,
805 ),
d6731600 806 'core_message_get_contacts' => array(
f23e9b6b
CB
807 'classname' => 'core_message_external',
808 'methodname' => 'get_contacts',
809 'classpath' => 'message/externallib.php',
d6731600 810 'description' => 'Retrieve the contact list',
f23e9b6b 811 'type' => 'read',
ee7295ee 812 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
d6731600 813 ),
aff9da17 814 'core_message_get_messages' => array(
f23e9b6b
CB
815 'classname' => 'core_message_external',
816 'methodname' => 'get_messages',
817 'classpath' => 'message/externallib.php',
818 'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
819 'type' => 'read',
ee7295ee 820 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3274d5ca
RW
821 'ajax' => true,
822 ),
8c55bd6c
RW
823 'core_message_get_unread_conversations_count' => array(
824 'classname' => 'core_message_external',
825 'methodname' => 'get_unread_conversations_count',
826 'classpath' => 'message/externallib.php',
827 'description' => 'Retrieve the count of unread conversations for a given user',
828 'type' => 'read',
829 'ajax' => true,
53522c6e 830 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8c55bd6c 831 ),
3274d5ca
RW
832 'core_message_mark_all_notifications_as_read' => array(
833 'classname' => 'core_message_external',
834 'methodname' => 'mark_all_notifications_as_read',
835 'classpath' => 'message/externallib.php',
8c55bd6c
RW
836 'description' => 'Mark all notifications as read for a given user',
837 'type' => 'write',
838 'ajax' => true,
53522c6e 839 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8c55bd6c
RW
840 ),
841 'core_message_mark_all_messages_as_read' => array(
842 'classname' => 'core_message_external',
843 'methodname' => 'mark_all_messages_as_read',
844 'classpath' => 'message/externallib.php',
845 'description' => 'Mark all messages as read for a given user',
3274d5ca
RW
846 'type' => 'write',
847 'ajax' => true,
53522c6e 848 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
60ab2e1b 849 ),
a84f89ca 850 'core_message_mark_message_read' => array(
f23e9b6b
CB
851 'classname' => 'core_message_external',
852 'methodname' => 'mark_message_read',
853 'classpath' => 'message/externallib.php',
854 'description' => 'Mark a single message as read, trigger message_viewed event.',
855 'type' => 'write',
ee7295ee 856 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
0b19d048 857 'ajax' => true,
a84f89ca 858 ),
a0eabdd3
RW
859 'core_message_message_processor_config_form' => array(
860 'classname' => 'core_message_external',
861 'methodname' => 'message_processor_config_form',
862 'classpath' => 'message/externallib.php',
863 'description' => 'Process the message processor config form',
864 'type' => 'write',
865 'ajax' => true,
53522c6e 866 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
a0eabdd3 867 ),
8c125526
RW
868 'core_message_get_message_processor' => array(
869 'classname' => 'core_message_external',
870 'methodname' => 'get_message_processor',
871 'classpath' => 'message/externallib.php',
872 'description' => 'Get a message processor',
873 'type' => 'read',
874 'ajax' => true,
875 ),
f23e9b6b
CB
876 'core_message_search_contacts' => array(
877 'classname' => 'core_message_external',
878 'methodname' => 'search_contacts',
879 'classpath' => 'message/externallib.php',
880 'description' => 'Search for contacts',
881 'type' => 'read',
ee7295ee 882 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
419b1128 883 ),
f23e9b6b
CB
884 'core_message_send_instant_messages' => array(
885 'classname' => 'core_message_external',
886 'methodname' => 'send_instant_messages',
887 'classpath' => 'message/externallib.php',
888 'description' => 'Send instant messages',
889 'type' => 'write',
ee7295ee 890 'capabilities' => 'moodle/site:sendmessage',
c060cd49 891 'ajax' => true,
ee7295ee 892 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
f23e9b6b
CB
893 ),
894 'core_message_unblock_contacts' => array(
895 'classname' => 'core_message_external',
896 'methodname' => 'unblock_contacts',
897 'classpath' => 'message/externallib.php',
898 'description' => 'Unblock contacts',
899 'type' => 'write',
c6e97f54 900 'ajax' => true,
ee7295ee 901 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 902 ),
e86f0cb4
JL
903 'core_message_get_user_notification_preferences' => array(
904 'classname' => 'core_message_external',
905 'methodname' => 'get_user_notification_preferences',
906 'classpath' => 'message/externallib.php',
907 'description' => 'Get the notification preferences for a given user.',
908 'type' => 'read',
909 'capabilities' => 'moodle/user:editownmessageprofile',
910 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
911 ),
2521afd2
JL
912 'core_message_get_user_message_preferences' => array(
913 'classname' => 'core_message_external',
914 'methodname' => 'get_user_message_preferences',
915 'classpath' => 'message/externallib.php',
916 'description' => 'Get the message preferences for a given user.',
917 'type' => 'read',
918 'capabilities' => 'moodle/user:editownmessageprofile',
919 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
920 ),
5d1017e1 921 'core_notes_create_notes' => array(
f23e9b6b
CB
922 'classname' => 'core_notes_external',
923 'methodname' => 'create_notes',
924 'classpath' => 'notes/externallib.php',
8d46dabb 925 'description' => 'Create notes',
f23e9b6b 926 'type' => 'write',
ee7295ee
JL
927 'capabilities' => 'moodle/notes:manage',
928 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8d46dabb 929 ),
34348b2b 930 'core_notes_delete_notes' => array(
f23e9b6b
CB
931 'classname' => 'core_notes_external',
932 'methodname' => 'delete_notes',
933 'classpath' => 'notes/externallib.php',
34348b2b 934 'description' => 'Delete notes',
f23e9b6b 935 'type' => 'write',
ee7295ee
JL
936 'capabilities' => 'moodle/notes:manage',
937 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
f23e9b6b
CB
938 ),
939 'core_notes_get_course_notes' => array(
940 'classname' => 'core_notes_external',
941 'methodname' => 'get_course_notes',
942 'classpath' => 'notes/externallib.php',
943 'description' => 'Returns all notes in specified course (or site), for the specified user.',
944 'type' => 'read',
ee7295ee
JL
945 'capabilities' => 'moodle/notes:view',
946 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
34348b2b 947 ),
34348b2b 948 'core_notes_get_notes' => array(
f23e9b6b
CB
949 'classname' => 'core_notes_external',
950 'methodname' => 'get_notes',
951 'classpath' => 'notes/externallib.php',
34348b2b 952 'description' => 'Get notes',
f23e9b6b
CB
953 'type' => 'read',
954 'capabilities' => 'moodle/notes:view'
34348b2b 955 ),
34348b2b 956 'core_notes_update_notes' => array(
f23e9b6b
CB
957 'classname' => 'core_notes_external',
958 'methodname' => 'update_notes',
959 'classpath' => 'notes/externallib.php',
34348b2b 960 'description' => 'Update notes',
f23e9b6b
CB
961 'type' => 'write',
962 'capabilities' => 'moodle/notes:manage'
34348b2b 963 ),
a80b5518 964 'core_notes_view_notes' => array(
f23e9b6b
CB
965 'classname' => 'core_notes_external',
966 'methodname' => 'view_notes',
967 'classpath' => 'notes/externallib.php',
968 'description' => 'Simulates the web interface view of notes/index.php: trigger events.',
969 'type' => 'write',
ee7295ee
JL
970 'capabilities' => 'moodle/notes:view',
971 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9028d9b5 972 ),
f23e9b6b
CB
973 'core_output_load_template' => array(
974 'classname' => 'core\output\external',
975 'methodname' => 'load_template',
976 'description' => 'Load a template for a renderable',
977 'type' => 'read',
5041600d
RT
978 'loginrequired' => false,
979 'ajax' => true,
0ff4ebb4 980 ),
e330b1c2 981 'core_output_load_fontawesome_icon_map' => array(
a26ce248 982 'classname' => 'core\output\external',
e330b1c2 983 'methodname' => 'load_fontawesome_icon_map',
a26ce248
DW
984 'description' => 'Load the mapping of names to icons',
985 'type' => 'read',
986 'loginrequired' => false,
987 'ajax' => true,
988 ),
f23e9b6b
CB
989 // Question related functions.
990 'core_question_update_flag' => array(
991 'classname' => 'core_question_external',
992 'methodname' => 'update_flag',
993 'description' => 'Update the flag state of a question attempt.',
994 'type' => 'write',
995 'capabilities' => 'moodle/question:flag',
ee7295ee 996 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3f0ea6d8 997 ),
f23e9b6b
CB
998 'core_rating_get_item_ratings' => array(
999 'classname' => 'core_rating_external',
1000 'methodname' => 'get_item_ratings',
1001 'description' => 'Retrieve all the ratings for an item.',
1002 'type' => 'read',
ee7295ee
JL
1003 'capabilities' => 'moodle/rating:view',
1004 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 1005 ),
afb7799a
JL
1006 'core_rating_add_rating' => array(
1007 'classname' => 'core_rating_external',
1008 'methodname' => 'add_rating',
1009 'description' => 'Rates an item.',
1010 'type' => 'write',
1011 'capabilities' => 'moodle/rating:rate',
1012 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1013 ),
f23e9b6b
CB
1014 'core_role_assign_roles' => array(
1015 'classname' => 'core_role_external',
1016 'methodname' => 'assign_roles',
1017 'classpath' => 'enrol/externallib.php',
1018 'description' => 'Manual role assignments.',
1019 'type' => 'write',
1020 'capabilities' => 'moodle/role:assign'
0bf486a6 1021 ),
f23e9b6b
CB
1022 'core_role_unassign_roles' => array(
1023 'classname' => 'core_role_external',
1024 'methodname' => 'unassign_roles',
1025 'classpath' => 'enrol/externallib.php',
1026 'description' => 'Manual role unassignments.',
1027 'type' => 'write',
1028 'capabilities' => 'moodle/role:assign'
11e76602 1029 ),
f23e9b6b
CB
1030 'core_tag_get_tagindex' => array(
1031 'classname' => 'core_tag_external',
1032 'methodname' => 'get_tagindex',
1033 'description' => 'Gets tag index page for one tag and one tag area',
1034 'type' => 'read',
5041600d 1035 'ajax' => true,
11e76602 1036 ),
f23e9b6b
CB
1037 'core_tag_get_tags' => array(
1038 'classname' => 'core_tag_external',
1039 'methodname' => 'get_tags',
1040 'description' => 'Gets tags by their ids',
1041 'type' => 'read',
5041600d 1042 'ajax' => true,
11e76602 1043 ),
f23e9b6b
CB
1044 'core_tag_update_tags' => array(
1045 'classname' => 'core_tag_external',
1046 'methodname' => 'update_tags',
1047 'description' => 'Updates tags',
1048 'type' => 'write',
5041600d 1049 'ajax' => true,
cc73ea07 1050 ),
cdc5f978 1051 'core_update_inplace_editable' => array(
f23e9b6b
CB
1052 'classname' => 'core_external',
1053 'methodname' => 'update_inplace_editable',
1054 'classpath' => 'lib/external/externallib.php',
cdc5f978 1055 'description' => 'Generic service to update title',
f23e9b6b 1056 'type' => 'write',
5041600d
RT
1057 'loginrequired' => true,
1058 'ajax' => true,
c66dc3df 1059 ),
f23e9b6b
CB
1060 'core_user_add_user_device' => array(
1061 'classname' => 'core_user_external',
1062 'methodname' => 'add_user_device',
1063 'classpath' => 'user/externallib.php',
1064 'description' => 'Store mobile user devices information for PUSH Notifications.',
1065 'type' => 'write',
ee7295ee 1066 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9bdcf579 1067 ),
f23e9b6b
CB
1068 'core_user_add_user_private_files' => array(
1069 'classname' => 'core_user_external',
1070 'methodname' => 'add_user_private_files',
1071 'classpath' => 'user/externallib.php',
1072 'description' => 'Copy files from a draft area to users private files area.',
1073 'type' => 'write',
ee7295ee
JL
1074 'capabilities' => 'moodle/user:manageownfiles',
1075 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
25c49a85 1076 ),
f23e9b6b
CB
1077 'core_user_create_users' => array(
1078 'classname' => 'core_user_external',
1079 'methodname' => 'create_users',
1080 'classpath' => 'user/externallib.php',
1081 'description' => 'Create users.',
1082 'type' => 'write',
1083 'capabilities' => 'moodle/user:create'
23b398fc 1084 ),
f23e9b6b
CB
1085 'core_user_delete_users' => array(
1086 'classname' => 'core_user_external',
1087 'methodname' => 'delete_users',
1088 'classpath' => 'user/externallib.php',
1089 'description' => 'Delete users.',
1090 'type' => 'write',
1091 'capabilities' => 'moodle/user:delete'
6c785afa 1092 ),
f23e9b6b
CB
1093 'core_user_get_course_user_profiles' => array(
1094 'classname' => 'core_user_external',
1095 'methodname' => 'get_course_user_profiles',
1096 'classpath' => 'user/externallib.php',
1097 'description' => 'Get course user profiles (each of the profils matching a course id and a user id),.',
1098 'type' => 'read',
1099 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
ee7295ee
JL
1100 . 'moodle/site:accessallgroups',
1101 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
6c785afa 1102 ),
f23e9b6b
CB
1103 'core_user_get_users' => array(
1104 'classname' => 'core_user_external',
1105 'methodname' => 'get_users',
1106 'classpath' => 'user/externallib.php',
1107 'description' => 'search for users matching the parameters',
1108 'type' => 'read',
1109 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update'
db5b6971 1110 ),
f23e9b6b
CB
1111 'core_user_get_users_by_field' => array(
1112 'classname' => 'core_user_external',
1113 'methodname' => 'get_users_by_field',
1114 'classpath' => 'user/externallib.php',
1115 'description' => 'Retrieve users\' information for a specified unique field - If you want to do a user search, use '
1116 . 'core_user_get_users()',
1117 'type' => 'read',
ee7295ee 1118 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
5041600d 1119 'ajax' => true,
ee7295ee 1120 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8e355853 1121 ),
f23e9b6b
CB
1122 'core_user_remove_user_device' => array(
1123 'classname' => 'core_user_external',
1124 'methodname' => 'remove_user_device',
1125 'classpath' => 'user/externallib.php',
1126 'description' => 'Remove a user device from the Moodle database.',
1127 'type' => 'write',
ee7295ee 1128 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
ef4c23cc 1129 ),
c598f278 1130 'core_user_update_users' => array(
a0eabdd3 1131 'classname' => 'core_user_external',
c598f278 1132 'methodname' => 'update_users',
a0eabdd3 1133 'classpath' => 'user/externallib.php',
c598f278 1134 'description' => 'Update users.',
a0eabdd3
RW
1135 'type' => 'write',
1136 'capabilities' => 'moodle/user:update',
1137 'ajax' => true,
1138 ),
c598f278 1139 'core_user_update_user_preferences' => array(
f23e9b6b 1140 'classname' => 'core_user_external',
c598f278 1141 'methodname' => 'update_user_preferences',
f23e9b6b 1142 'classpath' => 'user/externallib.php',
c598f278 1143 'description' => 'Update a user\'s preferences',
f23e9b6b 1144 'type' => 'write',
c598f278 1145 'capabilities' => 'moodle/user:editownmessageprofile, moodle/user:editmessageprofile',
a0eabdd3 1146 'ajax' => true,
6d2f938c 1147 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
c026a28d 1148 ),
f23e9b6b
CB
1149 'core_user_view_user_list' => array(
1150 'classname' => 'core_user_external',
1151 'methodname' => 'view_user_list',
1152 'classpath' => 'user/externallib.php',
1153 'description' => 'Simulates the web-interface view of user/index.php (triggering events),.',
1154 'type' => 'write',
1155 'capabilities' => 'moodle/course:viewparticipants',
ee7295ee 1156 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7361b968 1157 ),
f23e9b6b
CB
1158 'core_user_view_user_profile' => array(
1159 'classname' => 'core_user_external',
1160 'methodname' => 'view_user_profile',
1161 'classpath' => 'user/externallib.php',
1162 'description' => 'Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.',
1163 'type' => 'write',
1164 'capabilities' => 'moodle/user:viewdetails',
ee7295ee 1165 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
f4fb827e 1166 ),
45fec983
JL
1167 'core_user_get_user_preferences' => array(
1168 'classname' => 'core_user_external',
1169 'methodname' => 'get_user_preferences',
1170 'classpath' => 'user/externallib.php',
1171 'description' => 'Return user preferences.',
1172 'type' => 'read',
1173 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1174 ),
d44e2e42
JL
1175 'core_user_update_picture' => array(
1176 'classname' => 'core_user_external',
1177 'methodname' => 'update_picture',
1178 'classpath' => 'user/externallib.php',
1179 'description' => 'Update or delete the user picture in the site',
1180 'type' => 'write',
1181 'capabilities' => 'moodle/user:editownprofile, moodle/user:editprofile',
1182 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1183 ),
649777fb
JL
1184 'core_user_set_user_preferences' => array(
1185 'classname' => 'core_user_external',
1186 'methodname' => 'set_user_preferences',
1187 'classpath' => 'user/externallib.php',
1188 'description' => 'Set user preferences.',
1189 'type' => 'write',
1190 'capabilities' => 'moodle/site:config',
1191 ),
3e8145a3
JL
1192 'core_user_agree_site_policy' => array(
1193 'classname' => 'core_user_external',
1194 'methodname' => 'agree_site_policy',
1195 'classpath' => 'user/externallib.php',
1196 'description' => 'Agree the site policy for the current user.',
1197 'type' => 'write',
1198 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1199 ),
649777fb 1200
81de839f
FM
1201 // Competencies functions.
1202 'core_competency_create_competency_framework' => array(
1203 'classname' => 'core_competency\external',
1204 'methodname' => 'create_competency_framework',
1205 'classpath' => '',
1206 'description' => 'Creates new competency frameworks.',
1207 'type' => 'write',
1208 'capabilities' => 'moodle/competency:competencymanage',
1209 'ajax' => true,
1210 ),
1211 'core_competency_read_competency_framework' => array(
1212 'classname' => 'core_competency\external',
1213 'methodname' => 'read_competency_framework',
1214 'classpath' => '',
1215 'description' => 'Load a summary of a competency framework.',
1216 'type' => 'read',
1217 'capabilities' => 'moodle/competency:competencyview',
1218 'ajax' => true,
1219 ),
1220 'core_competency_duplicate_competency_framework' => array(
1221 'classname' => 'core_competency\external',
1222 'methodname' => 'duplicate_competency_framework',
1223 'classpath' => '',
1224 'description' => 'Duplicate a competency framework.',
1225 'type' => 'write',
1226 'capabilities' => 'moodle/competency:competencymanage',
1227 'ajax' => true,
1228 ),
1229 'core_competency_delete_competency_framework' => array(
1230 'classname' => 'core_competency\external',
1231 'methodname' => 'delete_competency_framework',
1232 'classpath' => '',
1233 'description' => 'Delete a competency framework.',
1234 'type' => 'write',
1235 'capabilities' => 'moodle/competency:competencymanage',
1236 'ajax' => true,
1237 ),
1238 'core_competency_update_competency_framework' => array(
1239 'classname' => 'core_competency\external',
1240 'methodname' => 'update_competency_framework',
1241 'classpath' => '',
1242 'description' => 'Update a competency framework.',
1243 'type' => 'write',
1244 'capabilities' => 'moodle/competency:competencymanage',
1245 'ajax' => true,
1246 ),
1247 'core_competency_list_competency_frameworks' => array(
1248 'classname' => 'core_competency\external',
1249 'methodname' => 'list_competency_frameworks',
1250 'classpath' => '',
1251 'description' => 'Load a list of a competency frameworks.',
1252 'type' => 'read',
1253 'capabilities' => 'moodle/competency:competencyview',
1254 'ajax' => true,
1255 ),
1256 'core_competency_count_competency_frameworks' => array(
1257 'classname' => 'core_competency\external',
1258 'methodname' => 'count_competency_frameworks',
1259 'classpath' => '',
1260 'description' => 'Count a list of a competency frameworks.',
1261 'type' => 'read',
1262 'capabilities' => 'moodle/competency:competencyview',
1263 'ajax' => true,
1264 ),
1265 'core_competency_competency_framework_viewed' => array(
1266 'classname' => 'core_competency\external',
1267 'methodname' => 'competency_framework_viewed',
1268 'classpath' => '',
1269 'description' => 'Log event competency framework viewed',
1270 'type' => 'read',
1271 'capabilities' => 'moodle/competency:competencyview',
1272 'ajax' => true,
1273 ),
1274 'core_competency_create_competency' => array(
1275 'classname' => 'core_competency\external',
1276 'methodname' => 'create_competency',
1277 'classpath' => '',
1278 'description' => 'Creates new competencies.',
1279 'type' => 'write',
1280 'capabilities' => 'moodle/competency:competencymanage',
1281 'ajax' => true,
1282 ),
1283 'core_competency_read_competency' => array(
1284 'classname' => 'core_competency\external',
1285 'methodname' => 'read_competency',
1286 'classpath' => '',
1287 'description' => 'Load a summary of a competency.',
1288 'type' => 'read',
1289 'capabilities' => 'moodle/competency:competencyview',
1290 'ajax' => true,
1291 ),
1292 'core_competency_competency_viewed' => array(
1293 'classname' => 'core_competency\external',
1294 'methodname' => 'competency_viewed',
1295 'classpath' => '',
1296 'description' => 'Log event competency viewed',
1297 'type' => 'read',
1298 'capabilities' => 'moodle/competency:competencyview',
1299 'ajax' => true,
3123c2cf 1300 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1301 ),
1302 'core_competency_delete_competency' => array(
1303 'classname' => 'core_competency\external',
1304 'methodname' => 'delete_competency',
1305 'classpath' => '',
1306 'description' => 'Delete a competency.',
1307 'type' => 'write',
1308 'capabilities' => 'moodle/competency:competencymanage',
1309 'ajax' => true,
1310 ),
1311 'core_competency_update_competency' => array(
1312 'classname' => 'core_competency\external',
1313 'methodname' => 'update_competency',
1314 'classpath' => '',
1315 'description' => 'Update a competency.',
1316 'type' => 'write',
1317 'capabilities' => 'moodle/competency:competencymanage',
1318 'ajax' => true,
1319 ),
1320 'core_competency_list_competencies' => array(
1321 'classname' => 'core_competency\external',
1322 'methodname' => 'list_competencies',
1323 'classpath' => '',
1324 'description' => 'Load a list of a competencies.',
1325 'type' => 'read',
1326 'capabilities' => 'moodle/competency:competencyview',
1327 'ajax' => true,
1328 ),
1329 'core_competency_list_competencies_in_template' => array(
1330 'classname' => 'core_competency\external',
1331 'methodname' => 'list_competencies_in_template',
1332 'classpath' => '',
1333 'description' => 'Load a list of a competencies for a given template.',
1334 'type' => 'read',
1335 'capabilities' => 'moodle/competency:competencyview',
1336 'ajax' => true,
1337 ),
1338 'core_competency_count_competencies' => array(
1339 'classname' => 'core_competency\external',
1340 'methodname' => 'count_competencies',
1341 'classpath' => '',
1342 'description' => 'Count a list of a competencies.',
1343 'type' => 'read',
1344 'capabilities' => 'moodle/competency:competencyview',
1345 'ajax' => true,
1346 ),
1347 'core_competency_count_competencies_in_template' => array(
1348 'classname' => 'core_competency\external',
1349 'methodname' => 'count_competencies_in_template',
1350 'classpath' => '',
1351 'description' => 'Count a list of a competencies for a given template.',
1352 'type' => 'read',
1353 'capabilities' => 'moodle/competency:competencyview',
1354 'ajax' => true,
1355 ),
1356 'core_competency_search_competencies' => array(
1357 'classname' => 'core_competency\external',
1358 'methodname' => 'search_competencies',
1359 'classpath' => '',
1360 'description' => 'Search a list of a competencies.',
1361 'type' => 'read',
1362 'capabilities' => 'moodle/competency:competencyview',
1363 'ajax' => true,
1364 ),
1365 'core_competency_set_parent_competency' => array(
1366 'classname' => 'core_competency\external',
1367 'methodname' => 'set_parent_competency',
1368 'classpath' => '',
1369 'description' => 'Set a new parent for a competency.',
1370 'type' => 'write',
1371 'capabilities' => 'moodle/competency:competencymanage',
1372 'ajax' => true,
1373 ),
1374 'core_competency_move_up_competency' => array(
1375 'classname' => 'core_competency\external',
1376 'methodname' => 'move_up_competency',
1377 'classpath' => '',
1378 'description' => 'Re-order a competency.',
1379 'type' => 'write',
1380 'capabilities' => 'moodle/competency:competencymanage',
1381 'ajax' => true,
1382 ),
1383 'core_competency_move_down_competency' => array(
1384 'classname' => 'core_competency\external',
1385 'methodname' => 'move_down_competency',
1386 'classpath' => '',
1387 'description' => 'Re-order a competency.',
1388 'type' => 'write',
1389 'capabilities' => 'moodle/competency:competencymanage',
1390 'ajax' => true,
1391 ),
1392 'core_competency_list_course_competencies' => array(
1393 'classname' => 'core_competency\external',
1394 'methodname' => 'list_course_competencies',
1395 'classpath' => '',
1396 'description' => 'List the competencies in a course',
1397 'type' => 'read',
1398 'capabilities' => 'moodle/competency:coursecompetencyview',
1399 'ajax' => true,
3123c2cf 1400 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1401 ),
1402 'core_competency_count_competencies_in_course' => array(
1403 'classname' => 'core_competency\external',
1404 'methodname' => 'count_competencies_in_course',
1405 'classpath' => '',
1406 'description' => 'List the competencies in a course',
1407 'type' => 'read',
1408 'capabilities' => 'moodle/competency:coursecompetencyview',
1409 'ajax' => true,
1410 ),
1411 'core_competency_count_courses_using_competency' => array(
1412 'classname' => 'core_competency\external',
1413 'methodname' => 'count_courses_using_competency',
1414 'classpath' => '',
1415 'description' => 'List the courses using a competency',
1416 'type' => 'read',
1417 'capabilities' => 'moodle/competency:coursecompetencyview',
1418 'ajax' => true,
1419 ),
1420 'core_competency_add_competency_to_course' => array(
1421 'classname' => 'core_competency\external',
1422 'methodname' => 'add_competency_to_course',
1423 'classpath' => '',
1424 'description' => 'Add the competency to a course',
1425 'type' => 'write',
1426 'capabilities' => 'moodle/competency:coursecompetencymanage',
1427 'ajax' => true,
1428 ),
1429 'core_competency_add_competency_to_template' => array(
1430 'classname' => 'core_competency\external',
1431 'methodname' => 'add_competency_to_template',
1432 'classpath' => '',
1433 'description' => 'Add the competency to a template',
1434 'type' => 'write',
1435 'capabilities' => 'moodle/competency:templatemanage',
1436 'ajax' => true,
1437 ),
1438 'core_competency_remove_competency_from_course' => array(
1439 'classname' => 'core_competency\external',
1440 'methodname' => 'remove_competency_from_course',
1441 'classpath' => '',
1442 'description' => 'Remove a competency from a course',
1443 'type' => 'write',
1444 'capabilities' => 'moodle/competency:coursecompetencymanage',
1445 'ajax' => true,
1446 ),
1447 'core_competency_set_course_competency_ruleoutcome' => array(
1448 'classname' => 'core_competency\external',
1449 'methodname' => 'set_course_competency_ruleoutcome',
1450 'classpath' => '',
1451 'description' => 'Modify the ruleoutcome value for course competency',
1452 'type' => 'write',
1453 'capabilities' => 'moodle/competency:coursecompetencymanage',
1454 'ajax' => true,
1455 ),
1456 'core_competency_remove_competency_from_template' => array(
1457 'classname' => 'core_competency\external',
1458 'methodname' => 'remove_competency_from_template',
1459 'classpath' => '',
1460 'description' => 'Remove a competency from a template',
1461 'type' => 'write',
1462 'capabilities' => 'moodle/competency:templatemanage',
1463 'ajax' => true,
1464 ),
1465 'core_competency_reorder_course_competency' => array(
1466 'classname' => 'core_competency\external',
1467 'methodname' => 'reorder_course_competency',
1468 'classpath' => '',
1469 'description' => 'Move a course competency to a new relative sort order.',
1470 'type' => 'write',
1471 'capabilities' => 'moodle/competency:coursecompetencymanage',
1472 'ajax' => true,
1473 ),
1474 'core_competency_reorder_template_competency' => array(
1475 'classname' => 'core_competency\external',
1476 'methodname' => 'reorder_template_competency',
1477 'classpath' => '',
1478 'description' => 'Move a template competency to a new relative sort order.',
1479 'type' => 'write',
1480 'capabilities' => 'moodle/competency:templatemanage',
1481 'ajax' => true,
1482 ),
1483 'core_competency_create_template' => array(
1484 'classname' => 'core_competency\external',
1485 'methodname' => 'create_template',
1486 'classpath' => '',
1487 'description' => 'Creates new learning plan templates.',
1488 'type' => 'write',
1489 'capabilities' => 'moodle/competency:templatemanage',
1490 'ajax' => true,
1491 ),
1492 'core_competency_duplicate_template' => array(
1493 'classname' => 'core_competency\external',
1494 'methodname' => 'duplicate_template',
1495 'classpath' => '',
1496 'description' => 'Duplicate learning plan template.',
1497 'type' => 'write',
1498 'capabilities' => 'moodle/competency:templatemanage',
1499 'ajax' => true,
1500 ),
1501 'core_competency_read_template' => array(
1502 'classname' => 'core_competency\external',
1503 'methodname' => 'read_template',
1504 'classpath' => '',
1505 'description' => 'Load a summary of a learning plan template.',
1506 'type' => 'read',
1507 'capabilities' => 'moodle/competency:templateview',
1508 'ajax' => true,
1509 ),
1510 'core_competency_delete_template' => array(
1511 'classname' => 'core_competency\external',
1512 'methodname' => 'delete_template',
1513 'classpath' => '',
1514 'description' => 'Delete a learning plan template.',
1515 'type' => 'write',
1516 'capabilities' => 'moodle/competency:templatemanage',
1517 'ajax' => true,
1518 ),
1519 'core_competency_update_template' => array(
1520 'classname' => 'core_competency\external',
1521 'methodname' => 'update_template',
1522 'classpath' => '',
1523 'description' => 'Update a learning plan template.',
1524 'type' => 'write',
1525 'capabilities' => 'moodle/competency:templatemanage',
1526 'ajax' => true,
1527 ),
1528 'core_competency_list_templates' => array(
1529 'classname' => 'core_competency\external',
1530 'methodname' => 'list_templates',
1531 'classpath' => '',
1532 'description' => 'Load a list of a learning plan templates.',
1533 'type' => 'read',
1534 'capabilities' => 'moodle/competency:templateview',
1535 'ajax' => true,
1536 ),
1537 'core_competency_list_templates_using_competency' => array(
1538 'classname' => 'core_competency\external',
1539 'methodname' => 'list_templates_using_competency',
1540 'classpath' => '',
1541 'description' => 'Load a list of a learning plan templates for a given competency.',
1542 'type' => 'read',
1543 'capabilities' => 'moodle/competency:templateview',
1544 'ajax' => true,
1545 ),
1546 'core_competency_count_templates' => array(
1547 'classname' => 'core_competency\external',
1548 'methodname' => 'count_templates',
1549 'classpath' => '',
1550 'description' => 'Count a list of a learning plan templates.',
1551 'type' => 'read',
1552 'capabilities' => 'moodle/competency:templateview',
1553 'ajax' => true,
1554 ),
1555 'core_competency_count_templates_using_competency' => array(
1556 'classname' => 'core_competency\external',
1557 'methodname' => 'count_templates_using_competency',
1558 'classpath' => '',
1559 'description' => 'Count a list of a learning plan templates for a given competency.',
1560 'type' => 'read',
1561 'capabilities' => 'moodle/competency:templateview',
1562 'ajax' => true,
1563 ),
1564 'core_competency_create_plan' => array(
1565 'classname' => 'core_competency\external',
1566 'methodname' => 'create_plan',
1567 'classpath' => '',
1568 'description' => 'Creates a learning plan.',
1569 'type' => 'write',
1570 'capabilities' => 'moodle/competency:planmanage',
1571 'ajax' => true,
1572 ),
1573 'core_competency_update_plan' => array(
1574 'classname' => 'core_competency\external',
1575 'methodname' => 'update_plan',
1576 'classpath' => '',
1577 'description' => 'Updates a learning plan.',
1578 'type' => 'write',
1579 'capabilities' => 'moodle/competency:planmanage',
1580 'ajax' => true,
1581 ),
1582 'core_competency_complete_plan' => array(
1583 'classname' => 'core_competency\external',
1584 'methodname' => 'complete_plan',
1585 'classpath' => '',
1586 'description' => 'Complete learning plan.',
1587 'type' => 'write',
1588 'capabilities' => 'moodle/competency:planmanage',
1589 'ajax' => true,
1590 ),
1591 'core_competency_reopen_plan' => array(
1592 'classname' => 'core_competency\external',
1593 'methodname' => 'reopen_plan',
1594 'classpath' => '',
1595 'description' => 'Reopen learning plan.',
1596 'type' => 'write',
1597 'capabilities' => 'moodle/competency:planmanage',
1598 'ajax' => true,
1599 ),
1600 'core_competency_read_plan' => array(
1601 'classname' => 'core_competency\external',
1602 'methodname' => 'read_plan',
1603 'classpath' => '',
1604 'description' => 'Load a learning plan.',
1605 'type' => 'read',
1606 'capabilities' => 'moodle/competency:planviewown',
1607 'ajax' => true,
1608 ),
1609 'core_competency_delete_plan' => array(
1610 'classname' => 'core_competency\external',
1611 'methodname' => 'delete_plan',
1612 'classpath' => '',
1613 'description' => 'Delete a learning plan.',
1614 'type' => 'write',
1615 'capabilities' => 'moodle/competency:planmanage',
1616 'ajax' => true,
1617 ),
1618 'core_competency_list_user_plans' => array(
1619 'classname' => 'core_competency\external',
1620 'methodname' => 'list_user_plans',
1621 'classpath' => '',
1622 'description' => 'List a user\'s learning plans.',
1623 'type' => 'read',
1624 'capabilities' => 'moodle/competency:planviewown',
1625 'ajax' => true,
1626 ),
1627 'core_competency_list_plan_competencies' => array(
1628 'classname' => 'core_competency\external',
1629 'methodname' => 'list_plan_competencies',
1630 'classpath' => '',
1631 'description' => 'List the competencies in a plan',
1632 'type' => 'read',
1633 'capabilities' => 'moodle/competency:planviewown',
1634 'ajax' => true,
1635 ),
1636 'core_competency_add_competency_to_plan' => array(
1637 'classname' => 'core_competency\external',
1638 'methodname' => 'add_competency_to_plan',
1639 'classpath' => '',
1640 'description' => 'Add the competency to a learning plan',
1641 'type' => 'write',
1642 'capabilities' => 'moodle/competency:planmanage',
1643 'ajax' => true,
1644 ),
1645 'core_competency_remove_competency_from_plan' => array(
1646 'classname' => 'core_competency\external',
1647 'methodname' => 'remove_competency_from_plan',
1648 'classpath' => '',
1649 'description' => 'Remove the competency from a learning plan',
1650 'type' => 'write',
1651 'capabilities' => 'moodle/competency:planmanage',
1652 'ajax' => true,
1653 ),
1654 'core_competency_reorder_plan_competency' => array(
1655 'classname' => 'core_competency\external',
1656 'methodname' => 'reorder_plan_competency',
1657 'classpath' => '',
1658 'description' => 'Move a plan competency to a new relative sort order.',
1659 'type' => 'write',
1660 'capabilities' => 'moodle/competency:planmanage',
1661 'ajax' => true,
1662 ),
1663 'core_competency_plan_request_review' => array(
1664 'classname' => 'core_competency\external',
1665 'methodname' => 'plan_request_review',
1666 'classpath' => '',
1667 'description' => 'Request for a plan to be reviewed.',
1668 'type' => 'write',
1669 'capabilities' => 'moodle/competency:planmanagedraft',
1670 'ajax' => true,
1671 ),
1672 'core_competency_plan_start_review' => array(
1673 'classname' => 'core_competency\external',
1674 'methodname' => 'plan_start_review',
1675 'classpath' => '',
1676 'description' => 'Start the review of a plan.',
1677 'type' => 'write',
1678 'capabilities' => 'moodle/competency:planmanage',
1679 'ajax' => true,
1680 ),
1681 'core_competency_plan_stop_review' => array(
1682 'classname' => 'core_competency\external',
1683 'methodname' => 'plan_stop_review',
1684 'classpath' => '',
1685 'description' => 'Stop the review of a plan.',
1686 'type' => 'write',
1687 'capabilities' => 'moodle/competency:planmanage',
1688 'ajax' => true,
1689 ),
1690 'core_competency_plan_cancel_review_request' => array(
1691 'classname' => 'core_competency\external',
1692 'methodname' => 'plan_cancel_review_request',
1693 'classpath' => '',
1694 'description' => 'Cancel the review of a plan.',
1695 'type' => 'write',
1696 'capabilities' => 'moodle/competency:planmanagedraft',
1697 'ajax' => true,
1698 ),
1699 'core_competency_approve_plan' => array(
1700 'classname' => 'core_competency\external',
1701 'methodname' => 'approve_plan',
1702 'classpath' => '',
1703 'description' => 'Approve a plan.',
1704 'type' => 'write',
1705 'capabilities' => 'moodle/competency:planmanage',
1706 'ajax' => true,
1707 ),
1708 'core_competency_unapprove_plan' => array(
1709 'classname' => 'core_competency\external',
1710 'methodname' => 'unapprove_plan',
1711 'classpath' => '',
1712 'description' => 'Unapprove a plan.',
1713 'type' => 'write',
1714 'capabilities' => 'moodle/competency:planmanage',
1715 'ajax' => true,
1716 ),
1717 'core_competency_template_has_related_data' => array(
1718 'classname' => 'core_competency\external',
1719 'methodname' => 'template_has_related_data',
1720 'classpath' => '',
1721 'description' => 'Check if a template has related data',
1722 'type' => 'read',
1723 'capabilities' => 'moodle/competency:templateview',
1724 'ajax' => true,
1725 ),
1726 'core_competency_get_scale_values' => array(
1727 'classname' => 'core_competency\external',
1728 'methodname' => 'get_scale_values',
1729 'classpath' => '',
1730 'description' => 'Fetch the values for a specific scale',
1731 'type' => 'read',
1732 'capabilities' => 'moodle/competency:competencymanage',
1733 'ajax' => true,
3123c2cf 1734 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1735 ),
1736 'core_competency_add_related_competency' => array(
1737 'classname' => 'core_competency\external',
1738 'methodname' => 'add_related_competency',
1739 'classpath' => '',
1740 'description' => 'Adds a related competency',
1741 'type' => 'write',
1742 'capabilities' => 'moodle/competency:competencymanage',
1743 'ajax' => true,
1744 ),
1745 'core_competency_remove_related_competency' => array(
1746 'classname' => 'core_competency\external',
1747 'methodname' => 'remove_related_competency',
1748 'classpath' => '',
1749 'description' => 'Remove a related competency',
1750 'type' => 'write',
1751 'capabilities' => 'moodle/competency:competencymanage',
1752 'ajax' => true,
1753 ),
1754 'core_competency_read_user_evidence' => array(
1755 'classname' => 'core_competency\external',
1756 'methodname' => 'read_user_evidence',
1757 'classpath' => '',
1758 'description' => 'Read an evidence of prior learning.',
1759 'type' => 'read',
1760 'capabilities' => 'moodle/competency:userevidenceview',
1761 'ajax' => true,
1762 ),
1763 'core_competency_delete_user_evidence' => array(
1764 'classname' => 'core_competency\external',
1765 'methodname' => 'delete_user_evidence',
1766 'classpath' => '',
1767 'description' => 'Delete an evidence of prior learning.',
1768 'type' => 'write',
1769 'capabilities' => 'moodle/competency:userevidencemanageown',
1770 'ajax' => true,
1771 ),
1772 'core_competency_create_user_evidence_competency' => array(
1773 'classname' => 'core_competency\external',
1774 'methodname' => 'create_user_evidence_competency',
1775 'classpath' => '',
1776 'description' => 'Create an evidence of prior learning relationship with a competency.',
1777 'type' => 'read',
1778 'capabilities' => 'moodle/competency:userevidencemanageown, moodle/competency:competencyview',
1779 'ajax' => true,
1780 ),
1781 'core_competency_delete_user_evidence_competency' => array(
1782 'classname' => 'core_competency\external',
1783 'methodname' => 'delete_user_evidence_competency',
1784 'classpath' => '',
1785 'description' => 'Delete an evidence of prior learning relationship with a competency.',
1786 'type' => 'write',
1787 'capabilities' => 'moodle/competency:userevidencemanageown',
1788 'ajax' => true,
1789 ),
1790 'core_competency_user_competency_cancel_review_request' => array(
1791 'classname' => 'core_competency\external',
1792 'methodname' => 'user_competency_cancel_review_request',
1793 'classpath' => '',
1794 'description' => 'Cancel a review request.',
1795 'type' => 'write',
1796 'capabilities' => 'moodle/competency:userevidencemanageown',
1797 'ajax' => true,
1798 ),
1799 'core_competency_user_competency_request_review' => array(
1800 'classname' => 'core_competency\external',
1801 'methodname' => 'user_competency_request_review',
1802 'classpath' => '',
1803 'description' => 'Request a review.',
1804 'type' => 'write',
1805 'capabilities' => 'moodle/competency:userevidencemanageown',
1806 'ajax' => true,
1807 ),
1808 'core_competency_user_competency_start_review' => array(
1809 'classname' => 'core_competency\external',
1810 'methodname' => 'user_competency_start_review',
1811 'classpath' => '',
1812 'description' => 'Start a review.',
1813 'type' => 'write',
1814 'capabilities' => 'moodle/competency:competencygrade',
1815 'ajax' => true,
1816 ),
1817 'core_competency_user_competency_stop_review' => array(
1818 'classname' => 'core_competency\external',
1819 'methodname' => 'user_competency_stop_review',
1820 'classpath' => '',
1821 'description' => 'Stop a review.',
1822 'type' => 'write',
1823 'capabilities' => 'moodle/competency:competencygrade',
1824 'ajax' => true,
1825 ),
1826 'core_competency_user_competency_viewed' => array(
1827 'classname' => 'core_competency\external',
1828 'methodname' => 'user_competency_viewed',
1829 'classpath' => '',
1830 'description' => 'Log the user competency viewed event.',
1831 'type' => 'read',
1832 'capabilities' => 'moodle/competency:usercompetencyview',
1833 'ajax' => true,
3123c2cf 1834 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1835 ),
1836 'core_competency_user_competency_viewed_in_plan' => array(
1837 'classname' => 'core_competency\external',
1838 'methodname' => 'user_competency_viewed_in_plan',
1839 'classpath' => '',
1840 'description' => 'Log the user competency viewed in plan event.',
1841 'type' => 'read',
1842 'capabilities' => 'moodle/competency:usercompetencyview',
1843 'ajax' => true,
3123c2cf 1844 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1845 ),
1846 'core_competency_user_competency_viewed_in_course' => array(
1847 'classname' => 'core_competency\external',
1848 'methodname' => 'user_competency_viewed_in_course',
1849 'classpath' => '',
1850 'description' => 'Log the user competency viewed in course event',
1851 'type' => 'read',
1852 'capabilities' => 'moodle/competency:usercompetencyview',
1853 'ajax' => true,
3123c2cf 1854 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1855 ),
1856 'core_competency_user_competency_plan_viewed' => array(
1857 'classname' => 'core_competency\external',
1858 'methodname' => 'user_competency_plan_viewed',
1859 'classpath' => '',
1860 'description' => 'Log the user competency plan viewed event.',
1861 'type' => 'read',
1862 'capabilities' => 'moodle/competency:usercompetencyview',
1863 'ajax' => true,
3123c2cf 1864 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1865 ),
1866 'core_competency_grade_competency' => array(
1867 'classname' => 'core_competency\external',
1868 'methodname' => 'grade_competency',
1869 'classpath' => '',
1870 'description' => 'Grade a competency.',
1871 'type' => 'write',
1872 'capabilities' => 'moodle/competency:competencygrade',
1873 'ajax' => true,
1874 ),
1875 'core_competency_grade_competency_in_plan' => array(
1876 'classname' => 'core_competency\external',
1877 'methodname' => 'grade_competency_in_plan',
1878 'classpath' => '',
1879 'description' => 'Grade a competency from the user plan page.',
1880 'type' => 'write',
1881 'capabilities' => 'moodle/competency:competencygrade',
1882 'ajax' => true,
1883 ),
1884 'core_competency_grade_competency_in_course' => array(
1885 'classname' => 'core_competency\external',
1886 'methodname' => 'grade_competency_in_course',
1887 'classpath' => '',
1888 'description' => 'Grade a competency from the course page.',
1889 'type' => 'write',
1890 'capabilities' => 'moodle/competency:competencygrade',
1891 'ajax' => true,
3123c2cf 1892 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1893 ),
1894 'core_competency_unlink_plan_from_template' => array(
1895 'classname' => 'core_competency\external',
1896 'methodname' => 'unlink_plan_from_template',
1897 'classpath' => '',
1898 'description' => 'Unlink a plan form it template.',
1899 'type' => 'write',
1900 'capabilities' => 'moodle/competency:planmanage',
1901 'ajax' => true,
1902 ),
1903 'core_competency_template_viewed' => array(
1904 'classname' => 'core_competency\external',
1905 'methodname' => 'template_viewed',
1906 'classpath' => '',
1907 'description' => 'Log event template viewed',
1908 'type' => 'read',
1909 'capabilities' => 'moodle/competency:templateview',
1910 'ajax' => true,
1911 ),
1912 'core_competency_request_review_of_user_evidence_linked_competencies' => array(
1913 'classname' => 'core_competency\external',
1914 'methodname' => 'request_review_of_user_evidence_linked_competencies',
1915 'classpath' => '',
1916 'description' => 'Send user evidence competencies in review',
1917 'type' => 'write',
1918 'capabilities' => 'moodle/competency:userevidencemanageown',
1919 'ajax' => true,
1920 ),
1921 'core_competency_update_course_competency_settings' => array(
1922 'classname' => 'core_competency\external',
1923 'methodname' => 'update_course_competency_settings',
1924 'classpath' => '',
1925 'description' => 'Update the course competency settings',
1926 'type' => 'write',
1927 'capabilities' => 'moodle/competency:coursecompetencyconfigure',
1928 'ajax' => true,
1929 ),
1e99f31e
FM
1930 'core_competency_delete_evidence' => array(
1931 'classname' => 'core_competency\external',
1932 'methodname' => 'delete_evidence',
1933 'classpath' => '',
1934 'description' => 'Delete an evidence',
1935 'type' => 'write',
1936 'capabilities' => 'moodle/competency:evidencedelete',
1937 'ajax' => true,
3123c2cf 1938 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1e99f31e 1939 ),
f23e9b6b
CB
1940
1941 'core_webservice_get_site_info' => array(
1942 'classname' => 'core_webservice_external',
1943 'methodname' => 'get_site_info',
1944 'classpath' => 'webservice/externallib.php',
1945 'description' => 'Return some site info / user info / list web service functions',
1946 'type' => 'read',
ee7295ee 1947 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8446ba36
JL
1948 ),
1949
1950 // Blocks functions.
1951 'core_block_get_course_blocks' => array(
1952 'classname' => 'core_block_external',
1953 'methodname' => 'get_course_blocks',
1954 'description' => 'Returns blocks information for a course.',
1955 'type' => 'read',
1956 'capabilities' => '',
1957 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1958 ),
9a0df45a 1959);
c1b65883
JM
1960
1961$services = array(
96e0194c 1962 'Moodle mobile web service' => array(
12c52b91 1963 'functions' => array(), // Unused as we add the service in each function definition, third party services would use this.
96e0194c
SH
1964 'enabled' => 0,
1965 'restrictedusers' => 0,
af03513f 1966 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
106c55fb
DW
1967 'downloadfiles' => 1,
1968 'uploadfiles' => 1
96e0194c
SH
1969 ),
1970);