09b4cb081a28e1513c1f6be9569924512f33c101
[moodle.git] / mod / forum / db / services.php
1 <?php
3 // This file is part of Moodle - http://moodle.org/
4 //
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
18 /**
19  * Forum external functions and service definitions.
20  *
21  * @package    mod_forum
22  * @copyright  2012 Mark Nelson <markn@moodle.com>
23  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24  */
26 $functions = array(
28     'mod_forum_get_forums_by_courses' => array(
29         'classname' => 'mod_forum_external',
30         'methodname' => 'get_forums_by_courses',
31         'classpath' => 'mod/forum/externallib.php',
32         'description' => 'Returns a list of forum instances in a provided set of courses, if
33             no courses are provided then all the forum instances the user has access to will be
34             returned.',
35         'type' => 'read',
36         'capabilities' => 'mod/forum:viewdiscussion'
37     ),
39     'mod_forum_get_forum_discussions' => array(
40         'classname' => 'mod_forum_external',
41         'methodname' => 'get_forum_discussions',
42         'classpath' => 'mod/forum/externallib.php',
43         'description' => 'Returns a list of forum discussions contained within a given set of forums.',
44         'type' => 'read',
45         'capabilities' => 'mod/forum:viewdiscussion, mod/forum:viewqandawithoutposting'
46     ),
48     'mod_forum_get_forum_discussion_posts' => array(
49         'classname' => 'mod_forum_external',
50         'methodname' => 'get_forum_discussion_posts',
51         'classpath' => 'mod/forum/externallib.php',
52         'description' => 'Returns a list of forum posts for a discussion.',
53         'type' => 'read',
54         'capabilities' => 'mod/forum:viewdiscussion, mod/forum:viewqandawithoutposting'
55     ),
57     'mod_forum_get_forum_discussions_paginated' => array(
58         'classname' => 'mod_forum_external',
59         'methodname' => 'get_forum_discussions_paginated',
60         'classpath' => 'mod/forum/externallib.php',
61         'description' => 'Returns a list of forum discussions optionally sorted and paginated.',
62         'type' => 'read',
63         'capabilities' => 'mod/forum:viewdiscussion, mod/forum:viewqandawithoutposting'
64     ),
66     'mod_forum_view_forum' => array(
67         'classname' => 'mod_forum_external',
68         'methodname' => 'view_forum',
69         'classpath' => 'mod/forum/externallib.php',
70         'description' => 'Simulate the view.php web interface page: trigger events, completion, etc...',
71         'type' => 'write',
72         'capabilities' => 'mod/forum:viewdiscussion'
73     ),
75     'mod_forum_view_forum_discussion' => array(
76         'classname' => 'mod_forum_external',
77         'methodname' => 'view_forum_discussion',
78         'classpath' => 'mod/forum/externallib.php',
79         'description' => 'Simulate the forum/discuss.php web interface page: trigger events, completion, etc...',
80         'type' => 'write',
81         'capabilities' => 'mod/forum:viewdiscussion'
82     ),
83 );