diff --git a/message/index.php b/message/index.php index 6ba3c9257d0..667dba47d46 100644 --- a/message/index.php +++ b/message/index.php @@ -69,8 +69,8 @@ $PAGE->set_url($url); /// Popup a window if required and quit (usually from external links). if ($popup) { $PAGE->set_pagelayout('popup'); - $OUTPUT->header(); - echo $PAGE->requires->js_function_call('openpopup', Array('/message/index.php', 'message', 'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500', 0))->asap(); + echo $OUTPUT->header(); + echo html_writer::script(js_writer::function_call('openpopup', Array('/message/index.php', 'message', 'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500', 0))); redirect("$CFG->wwwroot/", '', 0); exit; } diff --git a/message/refresh.php b/message/refresh.php index 22a9c839537..b482c7e11d5 100644 --- a/message/refresh.php +++ b/message/refresh.php @@ -83,7 +83,7 @@ $PAGE->requires->data_for_js('chatmessages', Array('msgcount'=>count($jsmessages echo $OUTPUT->header(); if (!empty($playbeep)) { echo ''; - echo $PAGE->requires->js_function_call('parent.send.focus')->asap(); + echo $PAGE->requires->js_function_call('parent.send.focus'); } // Javascript for Mozilla to cope with the redirect bug from editor being on in this page