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