--- loncom/interface/lonhtmlcommon.pm 2004/02/12 22:23:30 1.46
+++ loncom/interface/lonhtmlcommon.pm 2004/02/16 21:49:16 1.48
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.46 2004/02/12 22:23:30 matthew Exp $
+# $Id: lonhtmlcommon.pm,v 1.48 2004/02/16 21:49:16 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -56,6 +56,7 @@ html.
package Apache::lonhtmlcommon;
use Time::Local;
+use Time::HiRes;
use Apache::lonlocal;
use strict;
@@ -629,7 +630,7 @@ sub Create_PrgWin {
my ($r, $title, $heading, $number_to_do)=@_;
#the whole function called through timeout is due to issues
#in mozilla Read BUG #2665 if you want to know the whole story
- $r->print('');
+ &r_print($r,'');
$$prog_state{'laststart'}=&Time::HiRes::time();
- $r->rflush();
}
# increment progress state
@@ -707,21 +706,28 @@ sub Increment_PrgWin {
if ($user_browser eq 'explorer' && $user_os =~ 'mac') {
$lasttime = '';
}
- $r->print('');
+ &r_print($r,'');
$$prog_state{'laststart'}=&Time::HiRes::time();
- $r->rflush();
}
# close Progress Line
sub Close_PrgWin {
my ($r,$prog_state)=@_;
- $r->print(''."\n");
+ &r_print($r,''."\n");
undef(%$prog_state);
- $r->rflush();
}
+sub r_print {
+ my ($r,$to_print)=@_;
+ if ($r) {
+ $r->print($to_print);
+ $r->rflush();
+ } else {
+ print($to_print);
+ }
+}
# ------------------------------------------------------- Puts directory header