mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-65033 mod_forum: Toggle pin state via ajax
This commit is contained in:
parent
34e2f9c0c2
commit
25a97f99a9
@ -81,7 +81,19 @@ define(['core/ajax'], function(Ajax) {
|
||||
args: {
|
||||
forumid: forumId,
|
||||
discussionid: discussionId,
|
||||
targetstate: targetState
|
||||
targetstate: targetState}
|
||||
};
|
||||
return Ajax.call([request])[0];
|
||||
};
|
||||
|
||||
var togglePin = function(forumid, discussionid, targetstate, includetext) {
|
||||
var request = {
|
||||
methodname: 'mod_forum_set_pin_state',
|
||||
args: {
|
||||
forumid: forumid,
|
||||
discussionid: discussionid,
|
||||
targetstate: targetstate,
|
||||
includetext: includetext,
|
||||
}
|
||||
};
|
||||
return Ajax.call([request])[0];
|
||||
@ -91,6 +103,7 @@ define(['core/ajax'], function(Ajax) {
|
||||
setDiscussionSubscriptionState: setDiscussionSubscriptionState,
|
||||
addDiscussionPost: addDiscussionPost,
|
||||
setDiscussionLockState: setDiscussionLockState,
|
||||
toggleFavouriteDiscussionState: toggleFavouriteDiscussionState
|
||||
toggleFavouriteDiscussionState: toggleFavouriteDiscussionState,
|
||||
togglePin: togglePin
|
||||
};
|
||||
});
|
||||
|
@ -155,4 +155,13 @@ $functions = array(
|
||||
'ajax' => true,
|
||||
'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
|
||||
),
|
||||
'mod_forum_set_pin_state' => array(
|
||||
'classname' => 'mod_forum_external',
|
||||
'methodname' => 'set_pin_state',
|
||||
'classpath' => 'mod/forum/externallib.php',
|
||||
'description' => 'Set the pin state',
|
||||
'type' => 'write',
|
||||
'ajax' => true,
|
||||
'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
|
||||
),
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user