aboutsummaryrefslogtreecommitdiff
path: root/mod/simple_faq/start.php
blob: c4410eaa7d0c41c68964f25c8143ccc16fa48662 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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');
}