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