From e2bfe6c411a05e3332d754e01ae2ad46a0bcb770 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 2 Jun 2014 20:03:27 +0200 Subject: Continue to show minilinux download status even when refreshing the page --- inc/message.inc.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'inc/message.inc.php') diff --git a/inc/message.inc.php b/inc/message.inc.php index b62f234f..9405457d 100644 --- a/inc/message.inc.php +++ b/inc/message.inc.php @@ -107,6 +107,26 @@ class Message self::$flushed = true; } + /** + * Get all queued messages, flushing the queue. + * Useful in api/ajax mode. + */ + public static function asString() + { + global $error_text; + $return = ''; + foreach (self::$list as $item) { + $message = $error_text[$item['id']]; + foreach ($item['params'] as $index => $text) { + $message = str_replace('{{' . $index . '}}', $text, $message); + } + $return .= '[' . $item['type'] . ']: ' . $message . "\n"; + self::$alreadyDisplayed[] = $item; + } + self::$list = array(); + return $return; + } + /** * Deserialize any messages from the current HTTP request and * place them in the message queue. -- cgit v1.2.3-55-g7522