MDL-64863 tool_lp: Progress if needed

Do not immediately show progress bars since most operations work
in under a second. This will use the default timeout (5 seconds)
before showing progress bars.
This commit is contained in:
Damyon Wiese 2019-02-15 09:06:04 +08:00
parent a62e275984
commit 769cd8c4cc

View File

@ -274,7 +274,6 @@ class framework_importer {
// We are calling from browser, display progress bar. // We are calling from browser, display progress bar.
if ($this->useprogressbar === true) { if ($this->useprogressbar === true) {
$this->progress = new \core\progress\display_if_slow(get_string('processingfile', 'tool_lpimportcsv')); $this->progress = new \core\progress\display_if_slow(get_string('processingfile', 'tool_lpimportcsv'));
$this->progress->start_html();
} else { } else {
// Avoid html output on CLI scripts. // Avoid html output on CLI scripts.
$this->progress = new \core\progress\none(); $this->progress = new \core\progress\none();
@ -464,7 +463,6 @@ class framework_importer {
$framework = api::create_framework($record); $framework = api::create_framework($record);
if ($this->useprogressbar === true) { if ($this->useprogressbar === true) {
$this->progress = new \core\progress\display_if_slow(get_string('importingfile', 'tool_lpimportcsv')); $this->progress = new \core\progress\display_if_slow(get_string('importingfile', 'tool_lpimportcsv'));
$this->progress->start_html();
} else { } else {
$this->progress = new \core\progress\none(); $this->progress = new \core\progress\none();
} }