"MDL-12304, fix double text merged from MOODLE_19_STABLE"
This commit is contained in:
@@ -62,8 +62,8 @@
|
||||
$chat_newrow = ($chat_lastrow + $num) % 2;
|
||||
|
||||
// no & in url, does not work in header!
|
||||
$refreshurl = "{$CFG->wwwroot}/mod/chat/gui_header_js/jsupdate.php?chat_sid=$chat_sid&chat_lasttime=$chat_newlasttime&chat_lastrow=$chat_newrow";
|
||||
$refreshurlamp = "{$CFG->wwwroot}/mod/chat/gui_header_js/jsupdate.php?chat_sid=$chat_sid&chat_lasttime=$chat_newlasttime&chat_lastrow=$chat_newrow";
|
||||
$refreshurl = "{$CFG->wwwroot}/mod/chat/gui_header_js/jsupdate.php?chat_sid=$chat_sid&chat_lasttime=$chat_newlasttime&chat_lastrow=$chat_newrow";
|
||||
$refreshurlamp = "{$CFG->wwwroot}/mod/chat/gui_header_js/jsupdate.php?chat_sid=$chat_sid&chat_lasttime=$chat_newlasttime&chat_lastrow=$chat_newrow";
|
||||
|
||||
header('Expires: Sun, 28 Dec 1997 09:32:45 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
@@ -90,7 +90,7 @@
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
if (parent.msg.document.getElementById("msgStarted") == null) {
|
||||
if (parent.msg && parent.msg.document.getElementById("msgStarted") == null) {
|
||||
parent.msg.document.close();
|
||||
parent.msg.document.open("text/html","replace");
|
||||
parent.msg.document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
|
||||
@@ -116,6 +116,7 @@
|
||||
$refreshusers = true;
|
||||
}
|
||||
$us[$message->userid] = $timenow - $message->timestamp;
|
||||
echo "if(parent.msg)";
|
||||
echo "parent.msg.document.write('".addslashes_js($formatmessage->html)."\\n');\n";
|
||||
}
|
||||
}
|
||||
@@ -124,8 +125,12 @@
|
||||
$DB->set_field('chat_users', 'lastping', $chatuser->lastping, array('id'=>$chatuser->id));
|
||||
|
||||
if ($refreshusers) {
|
||||
echo "if (parent.users.document.anchors[1] != null) {" .
|
||||
"parent.users.location.href = parent.users.document.anchors[1].href;}\n";
|
||||
?>
|
||||
var link = parent.users.document.getElementById('refreshLink');
|
||||
if (link != null) {
|
||||
parent.users.location.href = link.href;
|
||||
}
|
||||
<?php
|
||||
} else {
|
||||
foreach($us as $uid=>$lastping) {
|
||||
$min = (int) ($lastping/60);
|
||||
@@ -133,12 +138,13 @@
|
||||
$min = $min < 10 ? '0'.$min : $min;
|
||||
$sec = $sec < 10 ? '0'.$sec : $sec;
|
||||
$idle = $min.':'.$sec;
|
||||
echo "if (parent.users.document.getElementById('uidle{$uid}') != null) {".
|
||||
echo "if (parent.users && parent.users.document.getElementById('uidle{$uid}') != null) {".
|
||||
"parent.users.document.getElementById('uidle{$uid}').innerHTML = '$idle';}\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
parent.msg.scroll(1,5000000);
|
||||
if(parent.msg)
|
||||
parent.msg.scroll(1,5000000);
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
@@ -155,7 +161,7 @@
|
||||
|
||||
// support HTTP Keep-Alive
|
||||
header("Content-Length: " . ob_get_length() );
|
||||
ob_end_flush();
|
||||
ob_end_flush();
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
$strbeep = get_string('beep', 'chat');
|
||||
|
||||
|
||||
echo '<div style="display: none"><a href="'.$refreshurl.'" name="refreshLink">Refresh link</a></div>';
|
||||
echo '<div style="display: none"><a href="'.$refreshurl.'" id="refreshLink">Refresh link</a></div>';
|
||||
echo '<table width="100%">';
|
||||
foreach ($chatusers as $chatuser) {
|
||||
$lastping = $timenow - $chatuser->lastmessageping;
|
||||
@@ -141,19 +141,19 @@
|
||||
//
|
||||
// Support HTTP Keep-Alive by printing Content-Length
|
||||
//
|
||||
// If the user pane is refreshing often, using keepalives
|
||||
// is lighter on the server and faster for most clients.
|
||||
// If the user pane is refreshing often, using keepalives
|
||||
// is lighter on the server and faster for most clients.
|
||||
//
|
||||
// Apache is normally configured to have a 15s timeout on
|
||||
// Apache is normally configured to have a 15s timeout on
|
||||
// keepalives, so let's observe that. Unfortunately, we cannot
|
||||
// autodetect the keepalive timeout.
|
||||
// autodetect the keepalive timeout.
|
||||
//
|
||||
// Using keepalives when the refresh is longer than the timeout
|
||||
// wastes server resources keeping an apache child around on a
|
||||
// connection that will timeout. So we don't.
|
||||
if ($CFG->chat_refresh_userlist < 15) {
|
||||
// wastes server resources keeping an apache child around on a
|
||||
// connection that will timeout. So we don't.
|
||||
if ($CFG->chat_refresh_userlist < 15) {
|
||||
header("Content-Length: " . ob_get_length() );
|
||||
ob_end_flush();
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
exit; // no further output
|
||||
|
||||
Reference in New Issue
Block a user