+
$starting
ENDPROGBAR
- $content.=&LCprogressbar_script();
- if ($mode eq 'popup') {
- $r->print(&modal_adhoc_launch('LCprogwin',500,50,$content));
- } else {
- $r->print($content);
- }
- $r->rflush();
+ &r_print($r,$content.&LCprogressbar_script($LCcurrentid));
}
sub LCprogressbarUpdate {
- my ($r,$val,$text,$mode)=@_;
- unless ($val) { $val=0; }
+ my ($r,$val,$text)=@_;
+ unless ($val) {
+ if ($LClastpercent) {
+ $val=$LClastpercent;
+ } else {
+ $val=0;
+ }
+ }
if ($val<0) { $val=0; }
if ($val>100) { $val=0; }
+ $LClastpercent=$val;
unless ($text) { $text=$val.'%'; }
- my $function='';
- if ($mode eq 'popup') { $function='modalWindow.'; }
- $function.='LCupdateProgress';
$text=&js_ready($text);
- $r->print(<
//
ENDUPDATE
- $r->rflush();
+}
+
+sub LCprogressbarClose {
+ my ($r)=@_;
+ $LClastpercent=0;
+ &r_print($r,<
+//
+
+ENDCLOSE
+}
+
+sub r_print {
+ my ($r,$to_print)=@_;
+ if ($r) {
+ $r->print($to_print);
+ $r->rflush();
+ } else {
+ print($to_print);
+ }
}
sub html_encode {
@@ -7222,6 +7253,7 @@ sub html_encode {
return $result;
}
+
sub js_ready {
my ($result) = @_;