summaryrefslogtreecommitdiff
blob: f1442758d09b57c2809d3507f212a909cfb9cb91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
function onshutdown($footerloc, $headerloc) {
	global $S;
	if (isset($S) && is_array($S) && !$S['notemplates']) {
		require_once($headerloc);
		if ($S['death']) {
			echo $S['death'];
		}
		require_once($footerloc);
	} elseif (isset($S['conf']) && isset($S) && is_array($S) && isset($_REQUEST) && isset($_REQUEST['ajax'])) {
		if (isset($S['death'])) {
			echo '<death_message>'.$S['death'].'</death_message>';
		}
		if ($S['conf']['debug']) {
			foreach ($S['debug'] as $row) {
				list($type, $text)=$row;
				echo '<debug>';
				if ($type !== null) {
					echo '<type>'.htmlentities($type).'</type>';
				}
				echo '<text>'.htmlentities($text).'</text>';
				echo '</debug>';
			}
		}
		echo ajaxresponsefooter();
	}
}
?>