MDL-68964 mod_chat: fix theme param
authorFerran Recio <ferran@moodle.com>
Wed, 29 Jul 2020 09:27:41 +0000 (11:27 +0200)
committerFerran Recio <ferran@moodle.com>
Wed, 12 Aug 2020 15:30:02 +0000 (17:30 +0200)
mod/chat/chat_ajax.php
mod/chat/gui_ajax/index.php
mod/chat/gui_ajax/module.js

index 40681f7..b925808 100644 (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);
index d1a15af..5139938 100644 (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) {
index 758df34..06819d8 100644 (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