aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-25 11:40:46 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-25 11:40:46 +0000
commit347b09527e5d812cd1ed67d6faa4ce0cba259b09 (patch)
tree32b636ea8502bcf4a5abbbbb7f3e819084a63131 /views
parent0c1b67ac3cf61daac65c15f43306ecc4d027fbdd (diff)
downloadelgg-347b09527e5d812cd1ed67d6faa4ce0cba259b09.tar.gz
elgg-347b09527e5d812cd1ed67d6faa4ce0cba259b09.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* git-svn-id: https://code.elgg.org/elgg/trunk@526 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r--views/default/api/output.php46
-rw-r--r--views/json/api/output.php19
-rw-r--r--views/json/pageshells/pageshell.php15
-rw-r--r--views/php/api/output.php19
-rw-r--r--views/php/pageshells/pageshell.php15
-rw-r--r--views/xml/api/output.php19
-rw-r--r--views/xml/pageshells/pageshell.php16
7 files changed, 149 insertions, 0 deletions
diff --git a/views/default/api/output.php b/views/default/api/output.php
new file mode 100644
index 000000000..70246e181
--- /dev/null
+++ b/views/default/api/output.php
@@ -0,0 +1,46 @@
+<?php
+ /**
+ * Elgg API default output
+ * This outputs the api in a human readable way.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @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> \ No newline at end of file
diff --git a/views/json/api/output.php b/views/json/api/output.php
new file mode 100644
index 000000000..84e0d1ec3
--- /dev/null
+++ b/views/json/api/output.php
@@ -0,0 +1,19 @@
+<?php
+ /**
+ * Elgg JSON output
+ * This outputs the api as JSON
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ */
+
+ $result = $vars['result'];
+ $export = $result->export();
+
+ echo json_encode($export);
+?> \ No newline at end of file
diff --git a/views/json/pageshells/pageshell.php b/views/json/pageshells/pageshell.php
new file mode 100644
index 000000000..5c01e030b
--- /dev/null
+++ b/views/json/pageshells/pageshell.php
@@ -0,0 +1,15 @@
+<?php
+ /**
+ * Elgg JSON output pageshell
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ */
+
+ echo $vars['body'];
+?> \ No newline at end of file
diff --git a/views/php/api/output.php b/views/php/api/output.php
new file mode 100644
index 000000000..6d1edcb05
--- /dev/null
+++ b/views/php/api/output.php
@@ -0,0 +1,19 @@
+<?php
+ /**
+ * Elgg PHP output
+ * This outputs the api as PHP
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ */
+
+ $result = $vars['result'];
+ $export = $result->export();
+
+ echo serialize($export);
+?> \ No newline at end of file
diff --git a/views/php/pageshells/pageshell.php b/views/php/pageshells/pageshell.php
new file mode 100644
index 000000000..30747720f
--- /dev/null
+++ b/views/php/pageshells/pageshell.php
@@ -0,0 +1,15 @@
+<?php
+ /**
+ * Elgg PHP output pageshell
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ */
+
+ echo $vars['body'];
+?> \ No newline at end of file
diff --git a/views/xml/api/output.php b/views/xml/api/output.php
new file mode 100644
index 000000000..aa385c9e3
--- /dev/null
+++ b/views/xml/api/output.php
@@ -0,0 +1,19 @@
+<?php
+ /**
+ * Elgg XML output
+ * This outputs the api as XML
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ */
+
+ $result = $vars['result'];
+ $export = $result->export();
+
+ echo serialise_object_to_xml($export, "elgg");
+?> \ No newline at end of file
diff --git a/views/xml/pageshells/pageshell.php b/views/xml/pageshells/pageshell.php
new file mode 100644
index 000000000..f5c7a4ce0
--- /dev/null
+++ b/views/xml/pageshells/pageshell.php
@@ -0,0 +1,16 @@
+<?php
+ /**
+ * Elgg XML output pageshell
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ */
+
+ header("Content-Type: text/xml");
+ echo $vars['body'];
+?> \ No newline at end of file