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