MDL-63805 glossary: New WS mod_glossary_update_entry
[moodle.git] / mod / glossary / db / services.php
CommitLineData
bf5bbe01
FM
1<?php
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
17/**
18 * Glossary module external functions.
19 *
20 * @package mod_glossary
21 * @category external
22 * @copyright 2015 Frédéric Massart - FMCorz.net
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 */
25
26defined('MOODLE_INTERNAL') || die();
27
28$functions = array(
29
30 'mod_glossary_get_glossaries_by_courses' => array(
31 'classname' => 'mod_glossary_external',
32 'methodname' => 'get_glossaries_by_courses',
33 'description' => 'Retrieve a list of glossaries from several courses.',
34 'type' => 'read',
0ca559a1
JL
35 'capabilities' => 'mod/glossary:view',
36 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
bf5bbe01
FM
37 ),
38
d0d4372c
FM
39 'mod_glossary_view_glossary' => array(
40 'classname' => 'mod_glossary_external',
41 'methodname' => 'view_glossary',
42 'description' => 'Notify the glossary as being viewed.',
43 'type' => 'write',
0ca559a1
JL
44 'capabilities' => 'mod/glossary:view',
45 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
d0d4372c
FM
46 ),
47
61fce284
FM
48 'mod_glossary_view_entry' => array(
49 'classname' => 'mod_glossary_external',
50 'methodname' => 'view_entry',
51 'description' => 'Notify a glossary entry as being viewed.',
52 'type' => 'write',
0ca559a1
JL
53 'capabilities' => 'mod/glossary:view',
54 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
61fce284 55 ),
fe11f9a4
FM
56
57 'mod_glossary_get_entries_by_letter' => array(
58 'classname' => 'mod_glossary_external',
59 'methodname' => 'get_entries_by_letter',
60 'description' => 'Browse entries by letter.',
61 'type' => 'read',
0ca559a1
JL
62 'capabilities' => 'mod/glossary:view',
63 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
fe11f9a4 64 ),
6a273d5a
FM
65
66 'mod_glossary_get_entries_by_date' => array(
67 'classname' => 'mod_glossary_external',
68 'methodname' => 'get_entries_by_date',
69 'description' => 'Browse entries by date.',
70 'type' => 'read',
0ca559a1
JL
71 'capabilities' => 'mod/glossary:view',
72 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
6a273d5a
FM
73 ),
74
bca824f7
FM
75 'mod_glossary_get_categories' => array(
76 'classname' => 'mod_glossary_external',
77 'methodname' => 'get_categories',
78 'description' => 'Get the categories.',
79 'type' => 'read',
0ca559a1
JL
80 'capabilities' => 'mod/glossary:view',
81 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
bca824f7
FM
82 ),
83
84 'mod_glossary_get_entries_by_category' => array(
85 'classname' => 'mod_glossary_external',
86 'methodname' => 'get_entries_by_category',
87 'description' => 'Browse entries by category.',
88 'type' => 'read',
0ca559a1
JL
89 'capabilities' => 'mod/glossary:view',
90 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
bca824f7
FM
91 ),
92
93 'mod_glossary_get_authors' => array(
94 'classname' => 'mod_glossary_external',
95 'methodname' => 'get_authors',
96 'description' => 'Get the authors.',
97 'type' => 'read',
0ca559a1
JL
98 'capabilities' => 'mod/glossary:view',
99 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
bca824f7
FM
100 ),
101
102 'mod_glossary_get_entries_by_author' => array(
103 'classname' => 'mod_glossary_external',
104 'methodname' => 'get_entries_by_author',
105 'description' => 'Browse entries by author.',
106 'type' => 'read',
0ca559a1
JL
107 'capabilities' => 'mod/glossary:view',
108 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
bca824f7
FM
109 ),
110
111 'mod_glossary_get_entries_by_author_id' => array(
112 'classname' => 'mod_glossary_external',
113 'methodname' => 'get_entries_by_author_id',
114 'description' => 'Browse entries by author ID.',
115 'type' => 'read',
0ca559a1
JL
116 'capabilities' => 'mod/glossary:view',
117 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
bca824f7
FM
118 ),
119
120 'mod_glossary_get_entries_by_search' => array(
121 'classname' => 'mod_glossary_external',
122 'methodname' => 'get_entries_by_search',
123 'description' => 'Browse entries by search query.',
124 'type' => 'read',
0ca559a1
JL
125 'capabilities' => 'mod/glossary:view',
126 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
bca824f7
FM
127 ),
128
129 'mod_glossary_get_entries_by_term' => array(
130 'classname' => 'mod_glossary_external',
131 'methodname' => 'get_entries_by_term',
132 'description' => 'Browse entries by term (concept or alias).',
133 'type' => 'read',
0ca559a1
JL
134 'capabilities' => 'mod/glossary:view',
135 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
bca824f7
FM
136 ),
137
138 'mod_glossary_get_entries_to_approve' => array(
139 'classname' => 'mod_glossary_external',
140 'methodname' => 'get_entries_to_approve',
141 'description' => 'Browse entries to be approved.',
142 'type' => 'read',
0ca559a1
JL
143 'capabilities' => 'mod/glossary:approve',
144 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
bca824f7
FM
145 ),
146
147 'mod_glossary_get_entry_by_id' => array(
148 'classname' => 'mod_glossary_external',
149 'methodname' => 'get_entry_by_id',
150 'description' => 'Get an entry by ID',
151 'type' => 'read',
0ca559a1
JL
152 'capabilities' => 'mod/glossary:view',
153 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
bca824f7
FM
154 ),
155
f0e1808f
JL
156 'mod_glossary_add_entry' => array(
157 'classname' => 'mod_glossary_external',
158 'methodname' => 'add_entry',
159 'description' => 'Add a new entry to a given glossary',
160 'type' => 'write',
161 'capabilities' => 'mod/glossary:write',
162 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
163 ),
164
4b64516b
JL
165 'mod_glossary_delete_entry' => [
166 'classname' => 'mod_glossary\external\delete_entry',
167 'methodname' => 'execute',
168 'classpath' => '',
169 'description' => 'Delete the given entry from the glossary.',
170 'type' => 'write',
171 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE]
172 ],
004be780
JL
173
174 'mod_glossary_update_entry' => [
175 'classname' => 'mod_glossary\external\update_entry',
176 'methodname' => 'execute',
177 'classpath' => '',
178 'description' => 'Updates the given glossary entry.',
179 'type' => 'write',
180 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE]
181 ],
bf5bbe01 182);