diff options
Diffstat (limited to 'start.php')
-rw-r--r-- | start.php | 19 |
1 files changed, 7 insertions, 12 deletions
@@ -8,31 +8,26 @@ * @license http://opensource.org/licenses/gpl-2.0.php GPL 2 */ -register_elgg_event_handler('init', 'system', 'opensearch_init'); +elgg_register_event_handler('init', 'system', 'opensearch_init'); function opensearch_init() { - global $CONFIG; - - register_page_handler('opensearch', 'opensearch_handler'); - - elgg_extend_view('metatags', 'opensearch/includes'); + 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 boolean + * @return bool */ function opensearch_handler($page) { - global $CONFIG; - switch ($page[0]) { case 'osd.xml': elgg_set_viewtype('xml'); - page_draw('', elgg_view('opensearch/description')); - return TRUE; + echo elgg_view_page('', elgg_view('opensearch/description')); + return true; break; } - + return false; } |