MDL-29441 Chat: Use a valid name for chat popup actions

This commit is contained in:
Andrew Nicols 2013-10-12 00:52:55 +08:00
parent f8eff10319
commit ee4ece6822
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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 '<p>';
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 '</p>';
$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 '<p>';
echo $OUTPUT->action_link($link, get_string('noframesjs', 'message'), $action, array('title'=>get_string('modulename', 'chat')));
echo '</p>';