]> git.mjollnir.org Git - moodle.git/commitdiff
Don't show progress bar when there's nothing worth showing
authormoodler <moodler>
Sat, 30 Sep 2006 13:52:15 +0000 (13:52 +0000)
committermoodler <moodler>
Sat, 30 Sep 2006 13:52:15 +0000 (13:52 +0000)
lib/adminlib.php

index 3aecb7be4d585f167c421b1d862fea618b7cde18..92a7a85a25d85f6e4eed28fe82935222966db50c 100644 (file)
@@ -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;