output.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Elgg API default output
  4. * This outputs the api in a human readable way.
  5. *
  6. * @package Elgg
  7. * @subpackage Core
  8. *
  9. */
  10. $result = $vars['result'];
  11. $export = $result->export();
  12. ?>
  13. <div id="api_result">
  14. <table width="100%">
  15. <tr><td width="100" valign="top"><b>Status:</b></td> <td>
  16. <?php
  17. if ($result instanceof SuccessResult)
  18. echo "OK";
  19. else
  20. echo "**** ERROR ({$export->status}) ****";
  21. ?>
  22. </td></tr>
  23. <?php if ($export->message!="") { ?>
  24. <tr><td width="100" valign="top"><b>Message:</b></td> <td><?php echo $export->message; ?></td></tr>
  25. <?php } ?>
  26. <?php if ($export->result) { ?>
  27. <tr><td width="100" valign="top"><b>Result:</b></td> <td><pre><?php print_r($export->result); ?></pre></td></tr>
  28. <?php } ?>
  29. <?php if ($export->pam) { ?>
  30. <tr><td width="100" valign="top"><b>PAM:</b></td> <td><pre><?php print_r($export->pam); ?></pre></td></tr>
  31. <?php } ?>
  32. <?php if ($export->runtime_errors) { ?>
  33. <tr><td width="100" valign="top"><b>Runtime:</b></td> <td><pre><?php print_r($export->runtime_errors); ?></pre></td></tr>
  34. <?php } ?>
  35. </table>
  36. </div>