From ee4ece6822ee94496f307a3fa8ed3dff562df8ef Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Sat, 12 Oct 2013 00:52:55 +0800 Subject: [PATCH] MDL-29441 Chat: Use a valid name for chat popup actions --- lib/javascript-static.js | 4 ++-- mod/chat/view.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 3d98c8b349d..1c1e19ccec7 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -1313,10 +1313,10 @@ function openpopup(event, args) { args.name = '_blank'; } else if (args.name.match(nameregex)) { // Cleans window name because IE does not support funky ones. - args.name = args.name.replace(nameregex, '_'); if (M.cfg.developerdebug) { - alert('DEVELOPER NOTICE: Invalid \'name\' passed to openpopup()'); + alert('DEVELOPER NOTICE: Invalid \'name\' passed to openpopup(): ' + args.name); } + args.name = args.name.replace(nameregex, '_'); } var fullurl = args.url; diff --git a/mod/chat/view.php b/mod/chat/view.php index f3423db7059..f029df53234 100644 --- a/mod/chat/view.php +++ b/mod/chat/view.php @@ -100,7 +100,7 @@ $currentgroup = groups_get_activity_group($cm, true); $params = array(); if ($currentgroup) { $groupselect = " AND groupid = '$currentgroup'"; - $groupparam = "&groupid=$currentgroup"; + $groupparam = "_group{$currentgroup}"; $params['groupid'] = $currentgroup; } else { $groupselect = ""; @@ -130,12 +130,12 @@ if (has_capability('mod/chat:chat', $context)) { $params['id'] = $chat->id; $chattarget = new moodle_url("/mod/chat/gui_$CFG->chat_method/index.php", $params); echo '

'; - echo $OUTPUT->action_link($chattarget, $strenterchat, new popup_action('click', $chattarget, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700))); + echo $OUTPUT->action_link($chattarget, $strenterchat, new popup_action('click', $chattarget, "chat{$course->id}_{$chat->id}{$groupparam}", array('height' => 500, 'width' => 700))); echo '

'; $params['id'] = $chat->id; $link = new moodle_url('/mod/chat/gui_basic/index.php', $params); - $action = new popup_action('click', $link, "chat{$course->id}{$chat->id}{$groupparam}", array('height' => 500, 'width' => 700)); + $action = new popup_action('click', $link, "chat{$course->id}_{$chat->id}{$groupparam}", array('height' => 500, 'width' => 700)); echo '

'; echo $OUTPUT->action_link($link, get_string('noframesjs', 'message'), $action, array('title'=>get_string('modulename', 'chat'))); echo '

';