Skip to content

Commit

Permalink
weblib progress_bar: Add a comment and fix some coding style.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhunt committed Apr 8, 2009
1 parent 5c2fec8 commit c9ec505
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -7186,7 +7186,13 @@ function console_write_error($identifier, $module='install', $use_string_lib=tru
die; die; die;
}


/**
* To use this class.
* - construct
* - call create (or use the 3rd param to the constructor)
* - call update or update_full repeatedly
* -
*/
class progress_bar {
private $html_id;
private $percent;
Expand Down Expand Up @@ -7305,14 +7311,16 @@ function estimate($curtime, $pt){
$one = $curtime - $this->lastcall->time;
$this->percent = $pt;
$percent = $pt - $this->lastcall->pt;
if($percent != 0)
if ($percent != 0) {
$left = ($one / $percent) - $consume;
else
} else {
return null;
if($left < 0)
}
if($left < 0) {
return 0;
else
} else {
return $left;
}
}
/**
* Update progress bar according percent
Expand Down

0 comments on commit c9ec505

Please sign in to comment.