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 | ef47af966edaf727834758f1a4fc7b1c19a0f230 (patch) | |
tree | f853217022b5e1a868a227dddc5c8010f4266e55 /start.php | |
download | elgg-ef47af966edaf727834758f1a4fc7b1c19a0f230.tar.gz elgg-ef47af966edaf727834758f1a4fc7b1c19a0f230.tar.bz2 |
Squashed 'mod/simple_faq/' content from commit 1852794
git-subtree-dir: mod/simple_faq
git-subtree-split: 1852794b849fcbab29c2b37ca6c106dc0cb9903d
Diffstat (limited to 'start.php')
-rw-r--r-- | start.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/start.php b/start.php new file mode 100644 index 000000000..c4410eaa7 --- /dev/null +++ b/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'); +} |