diff options
Diffstat (limited to 'views/xml')
-rw-r--r-- | views/xml/api/output.php | 14 | ||||
-rw-r--r-- | views/xml/messages/exceptions/exception.php | 25 | ||||
-rw-r--r-- | views/xml/opensearch/description.php | 75 | ||||
-rw-r--r-- | views/xml/page/default.php | 14 | ||||
-rw-r--r-- | views/xml/xml-rpc/output.php | 11 |
5 files changed, 64 insertions, 75 deletions
diff --git a/views/xml/api/output.php b/views/xml/api/output.php new file mode 100644 index 000000000..42afd44bb --- /dev/null +++ b/views/xml/api/output.php @@ -0,0 +1,14 @@ +<?php +/** + * Elgg XML output + * This outputs the api as XML + * + * @package Elgg + * @subpackage Core + * + */ + +$result = $vars['result']; +$export = $result->export(); + +echo serialise_object_to_xml($export, "elgg");
\ No newline at end of file diff --git a/views/xml/messages/exceptions/exception.php b/views/xml/messages/exceptions/exception.php new file mode 100644 index 000000000..66a0f2b96 --- /dev/null +++ b/views/xml/messages/exceptions/exception.php @@ -0,0 +1,25 @@ +<?php +/** + * Elgg exception + * Displays a single exception + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['object'] An exception + */ + +?> +<!-- +<?php echo get_class($vars['object']); ?>: <?php echo elgg_autop($vars['object']->getMessage()); ?> + + +<?php if (elgg_get_config('debug')) { ?> +<?php + + echo print_r($vars['object'], true); + + ?> +<?php } ?> + +-->
\ No newline at end of file diff --git a/views/xml/opensearch/description.php b/views/xml/opensearch/description.php deleted file mode 100644 index 586cadf83..000000000 --- a/views/xml/opensearch/description.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php -/** - * Creates an OpenSearch description document from plugin settings - * http://www.opensearch.org/Specifications/OpenSearch/1.1 - */ - -// reset cache headers because IE8 is stupid -header('Pragma: public', true); -header('Cache-Control: public', true); - -$site = elgg_get_site_entity(); -$email = $site->email; - -$shortname = elgg_get_plugin_setting('shortname', 'opensearch'); -$description = elgg_get_plugin_setting('desc', 'opensearch'); -$longname = elgg_get_plugin_setting('longname', 'opensearch'); -$icon = elgg_get_plugin_setting('icon', 'opensearch'); -$tags = elgg_get_plugin_setting('tags', 'opensearch'); -$lang = string_to_tag_array(elgg_get_plugin_setting('lang', 'opensearch')); -$query = elgg_get_plugin_setting('query', 'opensearch'); - -if (empty($shortname)) { - $shortname = $site->name; -} -if (empty($description)) { - $description = elgg_echo('opensearch:engine', array(elgg_get_site_entity()->name)); -} -if (empty($icon)) { - $icon = '_graphics/favicon.ico'; -} -if (empty($lang)) { - $lang = 'en-us'; -} - - -$rss_url = elgg_normalize_url('search/?q={searchTerms}&view=opensearch_rss'); -$rss_url = elgg_format_url($rss_url); -$html_url = elgg_normalize_url('search/?q={searchTerms}'); -$site_url = elgg_get_site_url(); - -?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName><?php echo $shortname; ?></ShortName> - <Description><?php echo $description; ?></Description> -<?php if (isset($longname)): ?> - <LongName><?php echo $longname; ?></LongName> -<?php endif; ?> - <Contact><?php echo $site->email; ?></Contact> - <Url type="text/html" template="<?php echo $html_url; ?>"/> - <Url type="application/rss+xml" template="<?php echo $rss_url; ?>"/> -<?php if (preg_match("/.ico$/", $icon)): ?> - <Image height="16" width="16" type="image/vnd.microsoft.icon"><?php echo "{$site_url}$icon"; ?></Image> -<?php elseif (preg_match("/.png$/", $icon)): ?> - <Image height="64" width="64" type="image/png"><?php echo "{$site_url}$icon"; ?></Image> -<?php endif; ?> -<?php if (isset($tags)): ?> - <Tags><?php echo $tags; ?></Tags> -<?php endif; ?> -<?php if (isset($query)): ?> - <Query role="example" searchTerms="<?php echo $query; ?>" /> -<?php endif; ?> -<?php -if (isset($lang)): - foreach ($lang as $language): -?> - <Language><?php echo $language; ?></Language> -<?php - endforeach; -endif; -?> - <SyndicationRight>open</SyndicationRight> - <AdultContent>false</AdultContent> - <OutputEncoding>UTF-8</OutputEncoding> - <InputEncoding>UTF-8</InputEncoding> - </OpenSearchDescription> diff --git a/views/xml/page/default.php b/views/xml/page/default.php new file mode 100644 index 000000000..0f0aecbe4 --- /dev/null +++ b/views/xml/page/default.php @@ -0,0 +1,14 @@ +<?php +/** + * Elgg XML output pageshell + * + * @package Elgg + * @subpackage Core + * + */ + +header("Content-Type: text/xml"); +// web server will handle setting the content length +//header("Content-Length: " . strlen($vars['body'])); +echo "<?xml version='1.0' encoding='UTF-8'?>\n"; +echo $vars['body'];
\ No newline at end of file diff --git a/views/xml/xml-rpc/output.php b/views/xml/xml-rpc/output.php new file mode 100644 index 000000000..4276029d1 --- /dev/null +++ b/views/xml/xml-rpc/output.php @@ -0,0 +1,11 @@ +<?php +/** + * Elgg XML output for XML-RPC + * + * @package Elgg + * @subpackage Core + */ + +$result = $vars['result']; + +echo "$result";
\ No newline at end of file |