diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:50:57 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:50:57 -0300 |
commit | 009578973540995e73d82c4820528560f77c4d93 (patch) | |
tree | 37d36686e925109a6add53259883cd78bbb5f93a /mod/simple_faq/start.php | |
parent | 8e863c9c0c6050b3905db80b25b9769d91f59eb6 (diff) | |
parent | ef47af966edaf727834758f1a4fc7b1c19a0f230 (diff) | |
download | elgg-009578973540995e73d82c4820528560f77c4d93.tar.gz elgg-009578973540995e73d82c4820528560f77c4d93.tar.bz2 |
Merge commit 'ef47af966edaf727834758f1a4fc7b1c19a0f230' as 'mod/simple_faq'
Diffstat (limited to 'mod/simple_faq/start.php')
-rw-r--r-- | mod/simple_faq/start.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mod/simple_faq/start.php b/mod/simple_faq/start.php new file mode 100644 index 000000000..c4410eaa7 --- /dev/null +++ b/mod/simple_faq/start.php @@ -0,0 +1,32 @@ +<?php +/** + * A Frequently Asked Question Plugin + * + * @package SimpleFAQ + */ + +elgg_register_event_handler('init', 'system', 'simple_faq_init'); + +/** + * Simple FAQ plugin initialization functions. + */ +function simple_faq_init() { + + // Footer navigation + $item = new ElggMenuItem('faq', elgg_echo('faq'), 'faq'); + elgg_register_menu_item('footer', $item); + + // Register a page handler, so we can have nice URLs + elgg_register_page_handler('faq', 'simple_faq_page_handler'); + + // register the faqs' JavaScript + $simple_faq_js = elgg_get_simplecache_url('js', 'simple_faq/toc'); + elgg_register_simplecache_view('js/simple_faq/toc'); + elgg_register_js('elgg.simple_faq', $simple_faq_js); + +} + +function simple_faq_page_handler($page) { + elgg_load_js('elgg.simple_faq'); + expages_page_handler($page, 'faq'); +} |