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