// Make sure, that the script realy realy diese here and now
$GLOBALS['app_died'] = TRUE;
- // Set content type as text/html
- setContentType('text/html');
+ // Is this AJAX mode?
+ if (isAjaxOutputMode()) {
+ // Set content type as application/json
+ setContentType('application/json');
+ } else {
+ // Set content type as text/html
+ setContentType('text/html');
+ }
// Load header
loadIncludeOnce('inc/header.php');
$message
);
- // Load the message template
- loadTemplate('app_exit_message', FALSE, $message);
+ // Is this AJAX mode again
+ if (isAjaxOutputMode()) {
+ // Load the message template
+ $OUT = loadTemplate('ajax_app_exit_message', TRUE, $message);
+
+ // Output it as JSON encoded
+ outputHtml(encodeJson(array('reply_content' => urlencode(doFinalCompilation($OUT)))));
+ } else {
+ // Load the message template
+ loadTemplate('app_exit_message', FALSE, $message);
+ }
// Load footer
loadIncludeOnce('inc/footer.php');