From c1b3ba3e0792b275a407cc87efec7ab141535a51 Mon Sep 17 00:00:00 2001 From: Ferran Recio Date: Wed, 29 Jul 2020 11:27:41 +0200 Subject: [PATCH] MDL-68964 mod_chat: fix theme param --- mod/chat/chat_ajax.php | 2 +- mod/chat/gui_ajax/index.php | 2 +- mod/chat/gui_ajax/module.js | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mod/chat/chat_ajax.php b/mod/chat/chat_ajax.php index 40681f73c2e..b925808d657 100644 --- a/mod/chat/chat_ajax.php +++ b/mod/chat/chat_ajax.php @@ -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); diff --git a/mod/chat/gui_ajax/index.php b/mod/chat/gui_ajax/index.php index d1a15af07c9..51399380eea 100644 --- a/mod/chat/gui_ajax/index.php +++ b/mod/chat/gui_ajax/index.php @@ -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) { diff --git a/mod/chat/gui_ajax/module.js b/mod/chat/gui_ajax/module.js index 758df345e99..06819d8d9c8 100644 --- a/mod/chat/gui_ajax/module.js +++ b/mod/chat/gui_ajax/module.js @@ -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