From: moodler Date: Sat, 30 Sep 2006 13:52:15 +0000 (+0000) Subject: Don't show progress bar when there's nothing worth showing X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=26ea488855384201555e7bfb802c4eb938ded0db;p=moodle.git Don't show progress bar when there's nothing worth showing --- diff --git a/lib/adminlib.php b/lib/adminlib.php index 3aecb7be4d..92a7a85a25 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -432,6 +432,10 @@ function print_progress($done, $total, $updatetime=5, $sleeptime=1, $donetext='' static $starttime; static $lasttime; + if ($total < 2) { // No need to show anything + return; + } + if (empty($starttime)) { $starttime = $lasttime = time(); $lasttime = $starttime - $updatetime;