summaryrefslogtreecommitdiffstats
path: root/inc/message.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2014-06-02 20:03:27 +0200
committerSimon Rettberg2014-06-02 20:03:27 +0200
commite2bfe6c411a05e3332d754e01ae2ad46a0bcb770 (patch)
tree33b7b6d1d8cb2626cc26738d7b05f8e69dae4cc2 /inc/message.inc.php
parentFix tracking of js taskmanager poller status; remove obsolete hack from taskm... (diff)
downloadslx-admin-e2bfe6c411a05e3332d754e01ae2ad46a0bcb770.tar.gz
slx-admin-e2bfe6c411a05e3332d754e01ae2ad46a0bcb770.tar.xz
slx-admin-e2bfe6c411a05e3332d754e01ae2ad46a0bcb770.zip
Continue to show minilinux download status even when refreshing the page
Diffstat (limited to 'inc/message.inc.php')
-rw-r--r--inc/message.inc.php20
1 files changed, 20 insertions, 0 deletions
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
@@ -108,6 +108,26 @@ class Message
}
/**
+ * 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.
*/