aboutsummaryrefslogtreecommitdiff
path: root/views/default/api/output.php
blob: 57b8461ea2fc3eded8b764a8631fb7212bddcff2 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
 * Elgg API default output
 * This outputs the api in a human readable way.
 *
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 *
 */

$result = $vars['result'];
$export = $result->export();

?>
<div id="api_result">
	<table width="100%">
		<tr><td width="100" valign="top"><b>Status:</b></td> <td>
			<?php
				if ($result instanceof SuccessResult)
					echo "OK";
				else
					echo "**** ERROR ({$export->status}) ****";
			?>
		</td></tr>

		<?php if ($export->message!="") { ?>
		<tr><td width="100" valign="top"><b>Message:</b></td> <td><?php echo $export->message; ?></td></tr>
		<?php } ?>
		<?php if ($export->result) { ?>
		<tr><td width="100" valign="top"><b>Result:</b></td> <td><pre><?php print_r($export->result); ?></pre></td></tr>
		<?php } ?>


		<?php if ($export->pam) { ?>
		<tr><td width="100" valign="top"><b>PAM:</b></td> <td><pre><?php print_r($export->pam); ?></pre></td></tr>
		<?php } ?>

		<?php if ($export->runtime_errors) { ?>
		<tr><td width="100" valign="top"><b>Runtime:</b></td> <td><pre><?php print_r($export->runtime_errors); ?></pre></td></tr>
		<?php } ?>
	</table>
</div>