diff options
author | Sem <sembrestels@riseup.net> | 2013-11-09 16:15:20 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2013-11-09 16:15:20 +0100 |
commit | 293fe873dcbedf45571807b722ce859e00a5a3a5 (patch) | |
tree | 4ce7adf3dbeed0a4ac2fbefd55f8844f504db499 /mod/opensearch/start.php | |
parent | ba0d506ade08ae46ba665474a8b9c81e838f2eee (diff) | |
parent | 853cb44b625cbe0e1cae3dff197d54645a1291a1 (diff) | |
download | elgg-293fe873dcbedf45571807b722ce859e00a5a3a5.tar.gz elgg-293fe873dcbedf45571807b722ce859e00a5a3a5.tar.bz2 |
Add 'mod/opensearch/' from commit '853cb44b625cbe0e1cae3dff197d54645a1291a1'
git-subtree-dir: mod/opensearch
git-subtree-mainline: ba0d506ade08ae46ba665474a8b9c81e838f2eee
git-subtree-split: 853cb44b625cbe0e1cae3dff197d54645a1291a1
Diffstat (limited to 'mod/opensearch/start.php')
-rw-r--r-- | mod/opensearch/start.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mod/opensearch/start.php b/mod/opensearch/start.php new file mode 100644 index 000000000..88329c8d1 --- /dev/null +++ b/mod/opensearch/start.php @@ -0,0 +1,33 @@ +<?php +/** + * OpenSearch plugin + * + * http://www.opensearch.org/Home + * + * @author Cash Costello + * @license http://opensource.org/licenses/gpl-2.0.php GPL 2 + */ + +elgg_register_event_handler('init', 'system', 'opensearch_init'); + +function opensearch_init() { + elgg_register_page_handler('opensearch', 'opensearch_handler'); + elgg_extend_view('page/elements/head', 'opensearch/includes'); +} + +/** + * Handles OpenSearch requests + * + * @param array $page An array of URL elements + * @return bool + */ +function opensearch_handler($page) { + switch ($page[0]) { + case 'osd.xml': + elgg_set_viewtype('xml'); + echo elgg_view_page('', elgg_view('opensearch/description')); + return true; + break; + } + return false; +} |