aboutsummaryrefslogtreecommitdiff
path: root/mod/members/start.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-01 11:32:39 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-01 11:32:39 +0000
commit3cfad8ca8394976823bbacb728821ca371dfd6d8 (patch)
tree2340be281845fbae688986c7129b84c26e913a0b /mod/members/start.php
parentdf9d347e7d5a316a7f5c85ba284ea68c26fe6d2c (diff)
downloadelgg-3cfad8ca8394976823bbacb728821ca371dfd6d8.tar.gz
elgg-3cfad8ca8394976823bbacb728821ca371dfd6d8.tar.bz2
Fixes #3231 welcome back, members plugin
git-svn-id: http://code.elgg.org/elgg/trunk@8895 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/members/start.php')
-rw-r--r--mod/members/start.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/mod/members/start.php b/mod/members/start.php
new file mode 100644
index 000000000..2c1793c17
--- /dev/null
+++ b/mod/members/start.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Members plugin intialization
+ */
+
+elgg_register_event_handler('init', 'system', 'members_init');
+
+/**
+ * Initialize page handler and site menu item
+ */
+function members_init() {
+ elgg_register_page_handler('members', 'members_page_handler');
+
+ $item = new ElggMenuItem('members', elgg_echo('members'), 'members');
+ elgg_register_menu_item('site', $item);
+}
+
+/**
+ * Members page handler
+ *
+ * @param array $page url segments
+ */
+function members_page_handler($page) {
+ $base = elgg_get_plugins_path() . 'members/pages/members';
+
+ if (!isset($page[0])) {
+ $page[0] = 'newest';
+ }
+
+ $vars = array();
+ $vars['page'] = $page[0];
+
+ if ($page[0] == 'search') {
+ $vars['search_type'] = $page[1];
+ require_once "$base/search.php";
+ } else {
+ require_once "$base/index.php";
+ }
+}