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