mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Merge branch 'MDL-84072-405' of https://github.com/paulholden/moodle into MOODLE_405_STABLE
This commit is contained in:
commit
9850eeb84a
@ -4765,7 +4765,13 @@ EOD;
|
||||
*/
|
||||
public function render_progress_bar_update(string $id, float $percent, string $msg, string $estimate,
|
||||
bool $error = false): string {
|
||||
return html_writer::script(js_writer::function_call('updateProgressBar', [$id, $percent, $msg, $estimate, $error]));
|
||||
return html_writer::script(js_writer::function_call('updateProgressBar', [
|
||||
$id,
|
||||
round($percent, 1),
|
||||
$msg,
|
||||
$estimate,
|
||||
$error,
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -181,7 +181,7 @@ class progress_bar implements renderable, templatable {
|
||||
$this->lastupdate = microtime(true);
|
||||
|
||||
if ($this->autoupdate) {
|
||||
echo $OUTPUT->render_progress_bar_update($this->idnumber, sprintf("%.1f", $this->percent), $msg, $estimatemsg);
|
||||
echo $OUTPUT->render_progress_bar_update($this->idnumber, $this->percent, $msg, $estimatemsg);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
@ -307,7 +307,7 @@ class progress_bar implements renderable, templatable {
|
||||
$this->message = $errormsg;
|
||||
|
||||
if ($this->autoupdate) {
|
||||
echo $OUTPUT->render_progress_bar_update($this->idnumber, sprintf("%.1f", $this->percent), $errormsg, '', true);
|
||||
echo $OUTPUT->render_progress_bar_update($this->idnumber, $this->percent, $errormsg, '', true);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ class stored_progress_bar extends progress_bar {
|
||||
// If we want the screen to auto update, render it.
|
||||
if ($this->autoupdate) {
|
||||
echo $OUTPUT->render_progress_bar_update(
|
||||
$this->idnumber, sprintf("%.1f", $this->percent), $this->message, $this->get_estimate_message($this->percent)
|
||||
$this->idnumber, $this->percent, $this->message, $this->get_estimate_message($this->percent)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user