Merge branch 'MDL-68964-master' of git://github.com/ferranrecio/moodle

This commit is contained in:
Adrian Greeve 2020-08-20 11:37:32 +08:00
commit 84d2d98c63
3 changed files with 8 additions and 8 deletions

View File

@ -22,7 +22,7 @@ require_once(__DIR__ . '/lib.php');
$action = optional_param('action', '', PARAM_ALPHANUM);
$beepid = optional_param('beep', '', PARAM_RAW);
$chatsid = required_param('chat_sid', PARAM_ALPHANUM);
$theme = required_param('theme', PARAM_ALPHANUMEXT);
$theme = required_param('chat_theme', PARAM_ALPHANUMEXT);
$chatmessage = optional_param('chat_message', '', PARAM_RAW);
$chatlasttime = optional_param('chat_lasttime', 0, PARAM_INT);
$chatlastrow = optional_param('chat_lastrow', 1, PARAM_INT);

View File

@ -19,7 +19,7 @@ require_once('../lib.php');
$id = required_param('id', PARAM_INT);
$groupid = optional_param('groupid', 0, PARAM_INT); // Only for teachers.
$theme = optional_param('theme', 'course_theme', PARAM_SAFEDIR); // The value course_theme == the current theme.
$theme = optional_param('chat_theme', 'course_theme', PARAM_SAFEDIR); // The value course_theme == the current theme.
$url = new moodle_url('/mod/chat/gui_ajax/index.php', array('id' => $id));
if ($groupid !== 0) {

View File

@ -91,7 +91,7 @@ M.mod_chat_ajax.init = function(Y, cfg) {
action : 'init',
chat_init : 1,
chat_sid : this.cfg.sid,
theme : this.theme
chat_theme : this.cfg.theme
}),
on : {
success : function(tid, outcome) {
@ -117,9 +117,9 @@ M.mod_chat_ajax.init = function(Y, cfg) {
// Create and initalise theme changing menu.
this.thememenu = new Y.YUI2.widget.Menu('basicmenu', {xy:[0,0]});
this.thememenu.addItems([
{text: M.util.get_string('bubble', 'mod_chat'), url: this.cfg.chaturl + '&theme=bubble'},
{text: M.util.get_string('compact', 'mod_chat'), url: this.cfg.chaturl + '&theme=compact'},
{text: M.util.get_string('coursetheme', 'mod_chat'), url: this.cfg.chaturl + '&theme=course_theme'}
{text: M.util.get_string('bubble', 'mod_chat'), url: this.cfg.chaturl + '&chat_theme=bubble'},
{text: M.util.get_string('compact', 'mod_chat'), url: this.cfg.chaturl + '&chat_theme=compact'},
{text: M.util.get_string('coursetheme', 'mod_chat'), url: this.cfg.chaturl + '&chat_theme=course_theme'}
]);
this.thememenu.render(document.body);
Y.one('#choosetheme').on('click', function(e) {
@ -145,7 +145,7 @@ M.mod_chat_ajax.init = function(Y, cfg) {
var data = {
chat_message : (!beep) ? this.messageinput.get('value') : '',
chat_sid : this.cfg.sid,
theme : this.cfg.theme
chat_theme : this.cfg.theme
};
if (beep) {
data.beep = beep
@ -193,7 +193,7 @@ M.mod_chat_ajax.init = function(Y, cfg) {
chat_lastrow : this.cfg.chat_lastrow || false,
chat_lasttime : this.cfg.chat_lasttime,
chat_sid : this.cfg.sid,
theme : this.cfg.theme
chat_theme : this.cfg.theme
}),
on : {
success : this.update_messages_callback